This is the mail archive of the
mailing list for the GCC project.
Re: PCH magic numbers
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Phil Edwards <phil at jaj dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 06 Aug 2003 00:02:46 -0700
- Subject: Re: PCH magic numbers
- References: <20030806021905.GA7000@disaster.jaj.com>
Phil Edwards <email@example.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 <firstname.lastname@example.org>