|
Prev: Edit Control
Next: Visual Studio's 2005 help?
From: Igor Tandetnik on 8 May 2008 07:45 "Tim Roberts" <timr(a)probo.com> wrote in message news:nv7524dtsq7k54scbbsa6e40r5r2js6glr(a)4ax.com > stevensmith1010(a)gmail.com wrote: >> >> Hi Dave, >> the problem is I have a very huge code and to manually go and change >> to __int64 would be very tedious....so thats why was thinking if >> there are some kind of compiler switches to force ints as >> __int64's...? > > Nope. In an intuitive world, "long" would be 64 bits in a 64-bit > compilation, as it is in gcc, but Microsoft decided we were all too > stupid to handle that. In my opinion, that was a huge mistake. I'm not sure I understand. long _is_ 64-bit in a 64-bit build, just like in GCC. What again are you complaining about? -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
From: Alex Blekhman on 8 May 2008 14:07 "Igor Tandetnik" wrote: > I'm not sure I understand. long _is_ 64-bit in a 64-bit build, > just like in GCC. What again are you complaining about? AFAIK, `long' data type is 32-bit in 64-bit MS C++ compiler. In order to get 64-bit integer type one should use `long long' type: "Data Type Ranges" http://msdn.microsoft.com/en-us/library/s3f49ktz.aspx Also, see: "Common Visual C++ 64-bit Migration Issues" http://msdn.microsoft.com/en-us/library/3b2e7499.aspx Alex
From: Tim Roberts on 9 May 2008 22:16 "Igor Tandetnik" <itandetnik(a)mvps.org> wrote: >"Tim Roberts" <timr(a)probo.com> wrote: >> stevensmith1010(a)gmail.com wrote: >>> >>> the problem is I have a very huge code and to manually go and change >>> to __int64 would be very tedious....so thats why was thinking if >>> there are some kind of compiler switches to force ints as >>> __int64's...? >> >> Nope. In an intuitive world, "long" would be 64 bits in a 64-bit >> compilation, as it is in gcc, but Microsoft decided we were all too >> stupid to handle that. In my opinion, that was a huge mistake. > >I'm not sure I understand. long _is_ 64-bit in a 64-bit build, just like >in GCC. What again are you complaining about? You are incorrect. In a Visual C++ 64-bit build, "long" is 32 bits. __int64 is the only built-in 64-bit type. The fact that YOU got this wrong is a testimony to how non-intuitive this move was. -- Tim Roberts, timr(a)probo.com Providenza & Boekelheide, Inc.
From: Ondrej Spanel on 15 May 2008 03:06 > values, why not use the __int64 type (or have a suitable redefinition > for portability). Some prefer long long over __int64 (seems to be somewhat more portable) Ondrej David Lowndes napsal(a): >> I am trying to port my VC++ application to a x64 compatible platform. >> >> Since most of my code makes use of int's ...( I noticed that an int is >> 32bits long on x64 mode as well)....I want to be able to use 64bit >> ints in my new code.... I was wondering if there is some option or >> setting in VC++ tht allows me to treat int's as 64 bit longs or 64 bit >> integers? > > None that I know of. It's implicit in Win64 that ints are still > 32-bit. > > If you have specific code that would benefit from having 64 bit > values, why not use the __int64 type (or have a suitable redefinition > for portability). > > Dave
From: Mycroft Holmes on 20 May 2008 04:49
> Since most of my code makes use of int's ...( I noticed that an int is > 32bits long on x64 mode as well)....I want to be able to use 64bit > ints in my new code.... I was wondering if there is some option or > setting in VC++ tht allows me to treat int's as 64 bit longs or 64 bit > integers? > you can use ptrdiff_t. this type is a signed integer, and it's usuallly the largest integer available (since it has to store memory offsets, it cannot be smaller than 64 bits on x64) |