[cfe-dev] size of pointer and size of long

Alireza.Moshtaghi at microchip.com Alireza.Moshtaghi at microchip.com
Tue Oct 21 21:25:11 PDT 2008


Thanks for the information,
For now in PIC16 port, I'll be setting the size of long long to zero and
by checking that in Preprocessor.cpp, I know if long long is supported
or not. Tentatively in the place where it is asserting, I'll leaving the
current code only for targets that have non zero long long.
I don't know if you want me to submit this patch or not. It seems to be
working for us at least for now until the final approach is adopted.

Regarding your proposal,
Similar enum is defined publicly in BuiltinType class. Can't that be
used instead of creating a new enum to become source of confusion?

> proposal: we add an enum IntType {UnsignedShort, SignedShort,
> UnsignedInt, SignedInt, UnsignedLong, SignedLong, UnsignedLongLong,
> SignedLongLong} to TargetInfo.  We add 4 new methods to TargetInfo,
> SizeType, IntMaxType, PtrDiffType, and WCharType, returning values
> from the enum.  The preprocessor and ASTContext then key off of these
> methods for the relevant types rather than trying to guess.
> 
> For HandleModeAttr, I'm not really sure what gcc does; could someone
> check the output of the following on OSX 32-bit?
> 
> typedef long a __attribute__((__mode__(__SI__)));
> int x[__builtin_types_compatible_p(a, long) ? 1 : -1];
> 
> -Eli




More information about the cfe-dev mailing list