On Tue, Oct 20, 2009 at 6:42 PM, tallpaul2000 <[email protected]> wrote: > --- In [email protected], Paul Herring <pauljherr...@...> wrote: >> On Tue, Oct 20, 2009 at 5:40 PM, tallpaul2000 <pado...@...> wrote: [...] >> > So then by the spec we are guaranteed that an int32_t will be at least 32 >> > bits wide. >> >> But, an int32_t is supposed to be an int that _is_ 32 bits wide, not >> _at_least_. >> >> You appear to be confusing char, int, long etc that have minimum >> widths with the intxx_t that have exact widths. > > No, looking at the typdefs for intxx_t in <stdint.h>, you still have no > guarantee of > _exact_ widths, only minimums. As far as I can tell, the C99 spec only states > minimum > widths.
For unadorned int, yes. For the ones intxx_t types no - they're exact widths: http://linux.die.net/man/3/int32_t ======== Detailed Description #include <stdint.h> Use [u]intN_t if you need exactly N bits. Since these typedefs are mandated by the C99 standard, they are preferred over rolling your own typedefs. Exact-width integer types Integer types having exactly the specified width typedef signed char int8_t typedef unsigned char uint8_t typedef signed int int16_t typedef unsigned int uint16_t typedef signed long int int32_t typedef unsigned long int uint32_t typedef signed long long int int64_t typedef unsigned long long int uint64_t ======== -- PJH http://shabbleland.myminicity.com/ http://www.chavgangs.com/register.php?referer=9375 http://www.kongregate.com/?referrer=Shabble
