[Bug pch/40272] error using precompiled headers with extra debug info (-g3)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40272 Jeffrey Walton noloader at gmail dot com changed: What|Removed |Added CC||noloader at gmail dot com --- Comment #5 from Jeffrey Walton noloader at gmail dot com 2010-12-05 14:01:38 UTC --- Confirmed. Bad: CXXFLAGS = -g3 -ggdb -DDEBUG -O0 -Wall -Wextra -Wno-unused-parameter -I. Good: CXXFLAGS = -g2 -ggdb -DDEBUG -O0 -Wall -Wextra -Wno-unused-parameter -I. Other buggy behavior: use a precompiled header. Add empty class files and include the the precompiled header. GCC crash. $ cat class-test.h #include pch.h $ cat class-test.cpp $ cat makefile CXX = g++ CXXFLAGS = -g3 -ggdb -DDEBUG -O0 -Wall -Wextra -Wno-unused-parameter -I. # CXXFLAGS = -g1 -DNDEBUG -O2 -Wall -Wextra -Wno-unused-parameter -I. COMMONSRCS = class-test.cpp EXESRCS = $(COMMONSRCS) EXEOBJS = $(EXESRCS:.cpp=.o) LDFLAGS = -lcrypto -lpthread default: precompile all all: test.exe precompile: $(CXX) $(CXXFLAGS) pch.h -o pch.h.gch test.exe: $(CXX) $(CXXFLAGS) $(EXESRCS) -o $@ $(LDFLAGS)
[Bug pch/40272] error using precompiled headers with extra debug info (-g3)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40272 --- Comment #4 from Jeffrey Walton noloader at gmail dot com 2010-12-05 14:01:18 UTC --- Created attachment 22643 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22643 GCC crash on precompiled header, -g3, and empty file
[Bug pch/40272] error using precompiled headers with extra debug info (-g3)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40272 Richard Guenther rguenth at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||DUPLICATE --- Comment #6 from Richard Guenther rguenth at gcc dot gnu.org 2010-12-05 22:20:24 UTC --- As a matter of fact it doesn't work reliably to include a precompiled header indirectly. And since GCC 4.5 that case will be detected and the PCH will not be used: 2009-09-22 Richard Guenther rguent...@suse.de PR pch/38987 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion. So I can also close it as dup if you like that more ;) More elaborate description of the problem in that bug. *** This bug has been marked as a duplicate of bug 38987 ***
[Bug pch/40272] error using precompiled headers with extra debug info (-g3)
--- Comment #3 from jay dot foad at gmail dot com 2010-06-08 14:24 --- I've just seen this too: $ gcc --version gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3 [...] $ cat a.h void a(void); $ cat b.h #include a.h $ cat b.c #include b.h void b(void) {} $ gcc -c -g3 a.h $ gcc -c -g3 b.c /tmp/ccpqcXiZ.s: Assembler messages: /tmp/ccpqcXiZ.s:429: Error: file number 2 already allocated -- jay dot foad at gmail dot com changed: What|Removed |Added CC||jay dot foad at gmail dot ||com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40272
[Bug pch/40272] error using precompiled headers with extra debug info (-g3)
--- Comment #1 from rguenth at gcc dot gnu dot org 2009-05-27 14:10 --- You have to include a precompiled header from the toplevel source file as the very first thing or preferably via the -include command-line parameter. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40272
[Bug pch/40272] error using precompiled headers with extra debug info (-g3)
--- Comment #2 from gafunchal at gmail dot com 2009-05-27 14:25 --- (In reply to comment #1) You have to include a precompiled header from the toplevel source file as the very first thing or preferably via the -include command-line parameter. I do not agree with that. The documentation section 3.20 says: * A precompiled header can't be used once the first C token is seen. You can have preprocessor directives before a precompiled header; you can even include a precompiled header from inside another header, so long as there are no C tokens before the `#include'. Please at least read what I'm saying before closing the bug as invalid, the error shows only when using -g3 so it's clearly NOT a matter of order-of-things. -- gafunchal at gmail dot com changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40272