OSDN Git Service

* cppexp.c (possible_sum_sign, integer_overflow, left_shift,
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / cpp / undef2.c
1 /* C99 6.10.8 para 4: None of [the predefined macro names] shall be
2    the subject of a #define or an #undef preprocessing directive.  We
3    pass -fno-show-column as otherwise dejagnu gets confused.  */
4
5 /* { dg-do preprocess } */
6 /* { dg-options "-fno-show-column" } */
7
8 #undef __DATE__         /* { dg-warning "undefining" "__DATE__" } */
9 #undef __TIME__         /* { dg-warning "undefining" "__TIME__" } */
10 #undef __FILE__         /* { dg-warning "undefining" "__FILE__" } */
11 #undef __LINE__         /* { dg-warning "undefining" "__LINE__" } */
12 #undef __STDC__         /* { dg-warning "undefining" "__STDC__" } */
13
14 /* These should be protected from #undef, but aren't, because they
15    are set with normal #define commands - and on top of that, some
16    of them are library properties, outside our control.  To consider:
17    warn about undefining/redefining any identifier beginning with
18    __STDC_ .
19
20    __STDC_HOSTED__
21    __STDC_VERSION__
22    __STDC_IEC_559__
23    __STDC_IEC_559_COMPLEX__
24    __STDC_ISO_10646__
25  */