Hi, I have a problem with undef and diagnostic pragma and I am not sure if I am doing something wrong or it's a GCC bug. The following code: #pragma GCC diagnostic ignored "-Wundef" #if FOO #endif int main (void) { return 42; } compiled in this way: gcc -o test test.c -Wundef -Werror does not give any error. On the contrary if I compile it with g++ g++ -o test test.c -Wundef -Werror gives test.c:2:5: error: "FOO" is not defined [-Werror=undef] cc1plus: all warnings being treated as errors gcc version is: gcc (Debian 4.7.0-8) 4.7.0 Why does preprocessor have this different behavior?