#import and PCH

Stan Shebs shebs@apple.com
Fri Jan 24 23:16:00 GMT 2003


Neil Booth wrote:

>Stan Shebs wrote:-
>
>
>>Does this work right with symlinks?  #import depends on being able to
>>detect file identity (I know, bleah bad evil etc etc), so I should
>>think your guard macro needs to have an inode number or some such
>>embedded in it.
>>
>>Unfortunately this is not a hypothetical issue, a build of Mac OS X
>>will likely go down in flames if you get this wrong, since there
>>are cases of multiple #imports through different paths but all
>>symlinking to a single file.
>>
>
>Unless you've changed this locally, we don't get that right at
>the moment.
>
There is indeed a patch in Apple's sources.  I did it, but didn't feel
that good about it. :-)  Geoff and I were just talking on the phone,
and agreed that putting inodes into PCH files was never going to be a
good idea - the recording of inodes in the old cpp-precomp precompiled
headers is a perennial root cause of tool problems on Macs, as you can
see from looking at Mac programming lists.

>
>We do get it right 99% of the time, because of the simplified
>pathnames we use.  So anything that works now will work with that,
>which is why I suggested it as the solution.
>
It's a good solution for FSF GCC.  Mac development still has a problem,
but no reason to trouble everybody here about that.

Stan






More information about the Gcc-patches mailing list