Why are __int8 and friends macros?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Why are __int8 and friends macros?

eric_niebler
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
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Why are __int8 and friends macros?

Francois Pichet
On Wed, Dec 15, 2010 at 3:27 PM, Eric Niebler <[hidden email]> 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.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev