[cfe-commits] r57132 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp lib/Lex/Preprocessor.cpp

Eli Friedman eli.friedman at gmail.com
Sun Oct 5 16:07:14 PDT 2008


On Sun, Oct 5, 2008 at 3:54 PM, Chris Lattner <sabre at nondot.org> wrote:
>
> On Oct 5, 2008, at 3:44 PM, Eli Friedman wrote:
>
>> On Sun, Oct 5, 2008 at 1:06 PM, Chris Lattner <sabre at nondot.org> wrote:
>>>
>>> it changes sizeof(long) to 16-bits (to match
>>> the size of pointer).
>>
>> Doesn't this violate the C standard?  AFAIK, long is required to be at
>> least 32 bits.
>
> I'm pretty sure it just has to be >= sizeof(int) and <= sizeof(long long).

All right, I dug up the reference:
C99 5.2.4.2.1p1:
Their implementation-defined values shall be equal or greater in magnitude
(absolute value) to those shown, with the same sign.

And a bit lower:
― maximum value for an object of type unsigned long int
ULONG_MAX         4294967295 // 2^32 − 1

-Eli



More information about the cfe-commits mailing list