From Bugzilla Helper: User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22.c4eb i686) Description of problem: g++ --version 2.96 When it compiles a file including <glade/glade.h>, it reports error as follows: g++ -c -g -Wall `gnome-config --cflags gnome gnomeui libglade` main.cpp In file included from /usr/include/glade/glade.h:50, from main.cpp:2: /usr/include/glade/glade-xml.h:32:9: malformed #pragma directive make: *** [main.o] Error 1 The offending pragma (with context) is #ifdef __cplusplus extern "C" { #pragma } #endif /* __cplusplus */ The file compiles fine using g++ version 2.95.2 How reproducible: Always Steps to Reproduce: 1. write a simple program including <glade/glade.h> as follows: // test.cpp #include <gnome.h> #include <glade/glade.h> int main(int argc, char * argv[]) { return 0; } 2. compile as follows: g++ `gnome-config --cflags gnome gnomeui libglade` test.cpp 3. Actual Results: In file included from /usr/include/glade/glade.h:50, from test.cpp:2: /usr/include/glade/glade-xml.h:32:9: malformed #pragma directive Expected Results: compile successfully Additional info: It might be a problem of the header file. The pragma is weird anyway.
The #pragma is really bogus first of all, so I don't think the preprocessor was wrong to moan about it. Anyway, the new preprocessor (present in cpp-2.96-72 and above, including e.g. the one shipped in 7.1 distribution) will not moan about it.