[cfe-dev] Why are __int8 and friends macros?

Francois Pichet pichet2000 at gmail.com
Thu Dec 16 14:38:06 PST 2010


On Wed, Dec 15, 2010 at 3:27 PM, Eric Niebler <eric at boostpro.com> wrote:
> When ms-extensions are turned on, __int8 becomes a #define for char.
> Likewise for __int16, __int32 and __int64 ... all #defines. This is not
> compatible with the MS compiler, where these are all actual keywords. A
> program can detect the difference by simply doing:
>
>  #ifdef __int8
>  #error __int8 should not be a macro
>  #endif
>
> I'd like to fix this, but I thought I'd ask first since it seems to have
> been done this way intentionally (although I can't imagine why).

I don't think it is intentional.. Feel free to fix it.. that's
something I need also since it creates a slight incompatibility
between clang -E and cl -E.




More information about the cfe-dev mailing list