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

Eric Niebler eric at boostpro.com
Wed Dec 15 12:27:22 PST 2010


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).

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com



More information about the cfe-dev mailing list