CPP problem
Zack Weinberg
zack@wolery.cumb.org
Thu Mar 2 09:43:00 GMT 2000
On Thu, Mar 02, 2000 at 11:29:04AM +0100, Alexander Mojaev wrote:
> Hi Zack,
>
> > Hmmmm. AFS has somewhat different semantics to real Unix
> > filesystems. Would you please send the .i file and the output of
> >
> > $ gcc z.c -I../../c/bug -v -H -E -dD -o z.i
>
> gcc z.c -I../../c/bug -v -H -E -dD -o z.i
> Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
> gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
...
> cat z.i
>
> # 1 "z.c"
> # 1 "../../c/bug/x.h" 1
>
> #define _X_
> #define X 1
>
> # 1 "z.c" 2
>
>
>
> int
> main()
> {
> return 1 + Y;
> }
Okay. I know what's wrong. For some reason, cpp has decided
../c/bug/x.h and ../c/bug/y.h refer to the same file. Since that file
has already been included, and its contents are ifdefed out, it
doesn't need to be reread. The most likely reason is that cpp is using
inode numbers to decide when two files are the same, but AFS isn't
providing it with real inode numbers. I don't know why it works for
'../bug' and not for '../../c/bug' - some internal issue with the AFS
client, probably.
I'd be interested to know if this problem still happens with a recent
snapshot of development gcc. The preprocessor has recently been
changed not to use inode numbers for that purpose. I can't test this
myself because I have no access to an AFS environment.
zw
More information about the Gcc
mailing list