[cfe-commits] patch: predefines available with -undef

Jay Foad jay.foad at gmail.com
Fri Jun 10 13:53:29 PDT 2011


Hi Nick,

> $ gcc -undef -dM -E -
> #define __STDC_HOSTED__ 1
> #define __STDC__ 1
> $ gcc -undef -dM -E -x assembler-with-cpp -
> #define __ASSEMBLER__ 1
> #define __STDC_HOSTED__ 1
> #define __STDC__ 1
> $ gcc-4.6 -undef -dM -E -x assembler-with-cpp - -ffreestanding
> #define __ASSEMBLER__ 1
> #define __STDC_HOSTED__ 0
> #define __STDC__ 1

Also:

$ gcc -undef -dM -E -x objective-c /dev/null
#define __OBJC__ 1
#define _FORTIFY_SOURCE 2
#define __STDC_HOSTED__ 1
#define __STDC__ 1

(Dunno why I have _FORTIFY_SOURCE here; the point is that __OBJC__
counts as a standard macro.) This is in line with GCC's documentation:

http://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros

Jay.



More information about the cfe-commits mailing list