[Bug pch/40215] GCH generated with -save-temps does not store preprocessor state.

2010-01-14 Thread JamesMikeDuPont at googlemail dot com


--- Comment #6 from JamesMikeDuPont at googlemail dot com  2010-01-14 13:55 
---
I am having this problem as well. 
Using the lastest version of g++.
Test like this :

If you include cassert in a pch, 
and then in the other file that uses the pch, the macro assert is no longer
there.


-- 


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



[Bug pch/40215] GCH generated with -save-temps does not store preprocessor state.

2009-05-21 Thread sacolcor at provide dot net


--- Comment #5 from sacolcor at provide dot net  2009-05-21 18:21 ---
(In reply to comment #4)
 How can the PCH contain information that is lost by using an external
 preprocessor?

When I do -save-temps, it's still using the GNU CPP, not an external one, so
it's not clear to me why information would be lost.  I'll update the summary
line so that it's clear that I'm not using an external preprocessor.

When a .h.gch is built in one pass, the integrated preprocessor takes the
preprocessor symbol state at the end of the file and passes it through (or
around) the compile and assemble phases to be stored in the .h.gch file.

It seems like the CPP should do the same thing when invoked as part of the
-save-temps chain; embed that same information in the .i* files.  Then when the
compiler phase sees it, it could pass it through and store that information in
the .h.gch.

Perhaps I need to understand more about how the PCH system works; I looked for
that information in the internal doc, but could not find anything.


-- 

sacolcor at provide dot net changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |
Summary|Generated GCH fails to honor|GCH generated with -save-
   |include guards with -no-|temps does not store
   |integrated-cpp  |preprocessor state.


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