Re: sizeof(aStruct) in Xcode 4
Re: sizeof(aStruct) in Xcode 4
- Subject: Re: sizeof(aStruct) in Xcode 4
- From: Sean McBride <email@hidden>
- Date: Tue, 21 Jun 2011 16:30:35 -0400
- Organization: Rogue Research Inc.
On Tue, 21 Jun 2011 16:00:42 -0400, Jocelyn Houle said:
>That said, int/short/long/long long sizes are somewhat variable across
>compilers and architectures, and you should use int8_t/int16_t/int32_t/
>int64_t, which are defined in stdint.h, and rarely missing from
>compilers nowadays
They are often missing, notably in MS compilers.
They are also part of C99, and technically only part of C++ as of C++11.
>(floats and doubles are pretty much 32b and 64b
>everywhere they represent IEEE 754 values, which is pretty much standard
>these days). BTW, those are guaranteed to be *at least* the number of
>bits (IIRC); technically, they could still be larger (so add some test
>unit/runtime check if you want to detect such situation), but I haven't
>encountered such a case ever since I started using them.
No, int32_t will be exactly 32 bits. You're thinking of int_least32_t perhaps.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden