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

Nick Lewycky nlewycky at google.com
Sat Jun 4 02:37:01 PDT 2011


This patch makes clang predefine some macros even when asked not to by the
-undef flag. I found real-world code which passes -undef and then tests for
these macros.

$ 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

Please review!

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110604/aafd0298/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-undef-predefines.patch
Type: text/x-patch
Size: 1881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110604/aafd0298/attachment.bin>


More information about the cfe-commits mailing list