[Bug pch/13675] #including a precompiled header more than once in the same unit fails

geoffk at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Apr 17 09:29:00 GMT 2004


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-04-17 08:12 -------
In the example, the file is called "pch-user1.cpp", not "pch-user1.c".  With identical files,

+ /tmp/gcc-20030730-1/bin/g++ -c -o pch-header.h.gch pch-header.h
+ /tmp/gcc-20030730-1/bin/g++ -c -o pch-user1.o pch-user1.cpp
In file included from pch-user1.cpp:2:
another-pch-user.h:1:24: calling fdopen: Bad file descriptor

but

+ /tmp/gcc-20030730-1/bin/gcc -c -o pch-header.h.gch pch-header.h
+ /tmp/gcc-20030730-1/bin/gcc -c -o pch-user1.o pch-user1.cpp
[completes successfully]

This is interesting (what is different about gcc vs. g++ in this case?), but mostly it's a gotcha for people 
like me who forget to use g++ and then can't reproduce the bug.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13675



More information about the Gcc-bugs mailing list