This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug pch/57242] gcc ignores precompiled headers unless the .gch and TU's are compiled with certain combinations of -g flag


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

--- Comment #3 from etherice <scottbaldwin at gmail dot com> ---
(In reply to Andrew Pinski from comment #1)
> This is by design as -g changes the information produced by the front-end
> and maybe even predefines too.

I think you may have read the report too quickly :)

When building the .gch file, and then subsequently building the translation
unit that uses the .gch ... even if you do not specify a -gN at all, or specify
the SAME -gN (unless both are -g3), the .gch will be ignored when compiling the
TU. For example, using -g2 for both (.gch and TU) will cause pch to be ignored.
Or using no -g flag at all for both (.gch and TU) will cause pch to be ignored.
You MUST specify a -g flag (either -g -g2 or -g3) when building the .gch, and
you must specify EXACTLY -g3 when building the TU. I hope that clarifies it.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]