This is the mail archive of the gcc-patches@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]

Re: ANSIfy cp/parser.c


On Fri, 10 Jan 2003, Devang Patel wrote:

> Not necessarily. If it is done right way then there will not be 
> separate data
> structures for each language affecting PCH as far as the prefix header
> does not contain language dependent constructs. I am not saying it is
> straightforward or easy.But If preprocessed output of header is 
> identical
> for each language than one PCH should work in unified front end.

Preprocessed output is highly unlikely to be the same in useful cases for
C and C++, since the standard C headers use extern "C", put things in
namespace "std", etc. in C++ (and have other requirements in C++ different
from the requirements in C).  Things might be more similar in some cases
between C and ObjC (are there any programs that are valid C and ObjC but
have different meanings in the two languages?) but you'd need some way for
PCH generation to tell "has flag_objc ever been tested in this
compilation?" to know whether the PCH file can be shared.  I believe the
present approach is that a PCH file is specific to a precise combination
of compiler flags.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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