Quote:Original post by nmi
Maybe you should read about LP32 and LP64:
http://www.opengroup.org/public/tech/aspen/lp64_wp.htm
I'd say that sums it up pretty well.
Quote:Original post by nmi
Maybe you should read about LP32 and LP64:
http://www.opengroup.org/public/tech/aspen/lp64_wp.htm
Quote:Original post by Dave HuntQuote:Original post by Evil Steve
I don't see why thet could cause problems, if it's a 64bit machine, then an int with be 64-bits too, won't it?
I'm not sure that's guaranteed, though it is probably true in practice. The standard only requires that an int be at least 16-bits. The intention was for an int to be the natural word size of the processor/platform, but it isn't a requirement.
Quote:Original post by Dave HuntQuote:Original post by MaulingMonkeyQuote:Original post by desertcube
Alternativly, just use std::size_t instead of unsigned int, then problem solved!
Quoted for emphisis. You can even do using std::size_t and then just type size_t instead of unsigned int.
size_t is actually a typedef in the global namespace, so you don't need the std:: or the using statement.
Quote:Original post by Polymorphic OOP
I'm pretty sure that size_t is only in namespace std in C++. Some versions of the Visual C++ compiler have size_t in the global namespace but I don't believe that is standard. Checking the standard on this.
Quote:Original post by DigitalDelusionQuote:Original post by Polymorphic OOP
I'm pretty sure that size_t is only in namespace std in C++. Some versions of the Visual C++ compiler have size_t in the global namespace but I don't believe that is standard. Checking the standard on this.
dunno... but it's declared in stddef.h so I my guess is that it's in the global namespace.
Quote:17.4.3.1.4
1 For each type from the Standard C library, the types ::T and ::std::T are reserved to the implementation and, when defined, ::T shall be identical to ::std::T.
Quote:Original post by Dave HuntQuote:Original post by MaulingMonkeyQuote:Original post by desertcube
Alternativly, just use std::size_t instead of unsigned int, then problem solved!
Quoted for emphisis. You can even do using std::size_t and then just type size_t instead of unsigned int.
size_t is actually a typedef in the global namespace, so you don't need the std:: or the using statement.
Quote:Original post by DigitalDelusionThe really bad thing is that many WinAPI functions now have versions that are '64 bit safe', but are defined to the 32 bit versions on 32-bit machines, thus giving you the warnings anyways =-/
Also note that vc2k3 has a nasty habbit on warning when you try to output the darn thing... if you're using streams there doesn't seem to be an overload for size_t (or more correctly it's underlying type) so it gets converted into a unsigned int spewing warnings all over the place... 64bit compatibility warnings are horrible and even ms own headers from the latest platform SDK gives warnings about it.
It's actually about the only warning I ever disable and ignore.