/ filename:c2011-6-4-7-ex.c // original examples and/or notes: // (c) ISO/IEC JTC1 SC22 WG14 N1570, April 12, 2011 // http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf // C2011 6.4.7 Header names // compile and output mechanism: // (c) Ogawa Kiyoshi, kaizen@gifu-u.ac.jp, December.xx, 2013 // compile errors and/or wornings: // 1(c) Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn) // Target: x86_64-apple-darwin11.4.2 //Thread model: posix // (c) LLVM 2003-2009 University of Illinois at Urbana-Champaign. // 2 gcc-4.9 (GCC) 4.9.0 20131229 (experimental) // Copyright (C) 2013 Free Software Foundation, Inc. #include <1/a.h> #define const.member@$ struct a { int h;} a; int main(void){ printf("%s",0x3<1/a.h>1e2); return printf("\n6.4.7 Header names\n"); } // 1. warning //c2011-6-4-7-ex.c:11:14: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions] //#define const.member@$ // ^ //1 warning and 2 errors generated. // 2, output GCC4.9 // (null) //6.4.7 Header names // 3. preprocessing // gcc-4.9 -E c2011-6-4-7-ex.c //# 1 "c2011-6-4-7-ex.c" //# 1 "" //# 1 "c2011-6-4-7-ex.c" //# 9 "c2011-6-4-7-ex.c" //# 1 "/usr/include/1/a.h" 1 3 4 //# 10 "c2011-6-4-7-ex.c" 2 //c2011-6-4-7-ex.c:10:14: warning: missing whitespace after the macro name [enabled by default] // #define const.member@$ // ^ //struct a { int h;} a; //int main(void){ // printf("%s",0x3<1/a.h>1e2); //return printf("\n6.4.7 Header names\n"); //}