This is the mail archive of the gcc@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: PCH magic numbers


Phil Edwards <phil@jaj.com> writes:

> How are the 3 characters at the end of the magic string to be interpreted?
> 3-digit decimal number, 2-digit hex with a leading zero, ...?  Do the digits
> have categories like SMTP response codes, or do they just go from 000 to 999?

The idea was that you'd increment the number when you made an
incompatible change to the initial part of the PCH file; but you don't
*have* to use numbers, any bytes will do.

The characters aren't interpreted.  Their only purpose is to prevent
GCC executable A from trying to read a PCH file created by a different
GCC executable B.  They don't do a very good job, for instance, they
don't prevent a 64-bit-hosted version of GCC from trying to read a PCH
created by a 32-bit-hosted version of GCC; in future, I hope to do
this better, if for no other reason than to provide better error
messages, but at least what's there now is better than nothing and is
extendable in future.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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