any difference in 32bit vs 64bit programming?

Started by
7 comments, last by SiCrane 16 years, 2 months ago
I'm currently running win xp pro 32bit and VS2005 standard. If I upgrade to win xp 64bit or vista 64bit what types of problems can I expect in terms of programming? I know that's a vague question. When working with Win32 or SDL, are there major things I'm going to have to do differently, or are thing pretty much the same. I imagine there will be a few project properties I'll have to change, but the code should all be the same.
Advertisement
I think the biggest change would be to do with sizeof(variables). Things like long ints might not be 4 bytes anymore, pointers will definitelely be larger, etc. So I think if you're doing some stuff that depends on variables being the size that they are on 32 bits (like networking), you'll have to make some changes to your code.

Other than that, I'm not too sure and would also be interested in knowing the answer. I remember seeing an article on this, and it was quite lengthy.

Oh, here's that article. I didn't read it though.

http://www.gamedev.net/reference/programming/features/20issues64bit
Hi,

Nothing will change too much for you.
Common problems that might occur with your code:

- Pointer size. Dangerous together with evil casts and other stuff ...
- A few problem with functions in the WinAPI (such as GetWindowLong() which must be replaced with GetWindowLongPtr())
- Problems with Inline-Assembly in your code. AFAIK not anymore supported for x64 (and even if it was supported not working without modifications)

If you activate the w64 warnings in VS 2005 the compiler will show you most potential problems, but not all.
If you write clean code without hacking around too much in poor memory you should have no problems.

Best regards,
Porthos

[Edited by - Porthos on March 25, 2008 7:16:18 PM]
Quote:Original post by localrob2
I'm currently running win xp pro 32bit and VS2005 standard.
If I upgrade to win xp 64bit or vista 64bit what types of problems can I expect in terms of programming?
I know that's a vague question. When working with Win32 or SDL, are there major things I'm going to have to do differently, or are thing pretty much the same. I imagine there will be a few project properties I'll have to change, but the code should all be the same.


Do you mean you want to upgrade your operating system to x64? In that case, you have to do nothing. Your 32-bit application will run just fine on the x64 systems.

If you are talking about porting your code to be compiled for the architecture, you will have to worry about the issues mentioned above. Note that if you plan on releasing it to the public you will need to compile an x86 version as well as the x64 version, since most consumers have not switched over.
Thanks for all the replies.

Quote:Original post by frob
Your 32-bit application will run just fine on the x64 systems.

If you are talking about porting your code to be compiled for the architecture, you will have to worry about the issues mentioned above.


So I should just be able to continue things as normal if I only plan on releasing an x86 program.
Quote:Original post by localrob2
I'm currently running win xp pro 32bit and VS2005 standard.
If I upgrade to win xp 64bit or vista 64bit what types of problems can I expect in terms of programming?
I know that's a vague question. When working with Win32 or SDL, are there major things I'm going to have to do differently, or are thing pretty much the same. I imagine there will be a few project properties I'll have to change, but the code should all be the same.


from MSDN:
1) Getting Ready for 64-bit Windows
2) General Porting Guidelines


Quote:Original post by localrob2
So I should just be able to continue things as normal if I only plan on releasing an x86 program.
Yes.

If you have the warning level at maximum in Visual Studio (As you really should do), it'll already warn about 64-bit compatability issues.

It's a good idea to be able to compile a 64-bit version of your app, just because you can :P
Ya but VS 2008 warns that enabling 64 bit warnings is deprecated.. quite annoying so I turned it off.
/Wp64 isn't a particularly useful warning level for the simple reason that it throws up too many false positives. If you have an integral typedef that will be 32 bits in a 32 bit build and 64 bits in a 64 bit build, /Wp64 will still give you a lot of grief assigning to it from pointer sized values, despite the fact that you are properly handling things.

This topic is closed to new replies.

Advertisement