This is the mail archive of the gcc-bugs@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: Problems compiling current CVS under cygwin.

[Get raw message]
Neil,

I put a trace into the cppfiles.c function open_file to print out the
include files as they are opened and I found that there was indeed a
recursive set of include files as shown by the output below.

$ /build/arm/gcc/gcc/fix-header dirent.h
/xgcc-arm/gnu/arm-elf/sys-include/dirent.h
/build/arm/gcc/gcc/include/dirent.h -D__STDC__=0 -D__cplusplus -/build/arm/g
cc/gcc/include -I/xgcc-arm/gnu/arm-elf/sys-include
Filename for open </xgcc-arm/gnu/arm-elf/sys-include/dirent.h>
Filename for open </build/arm/gcc/gcc/include/sys/dirent.h>
Filename for open </xgcc-arm/gnu/arm-elf/sys-include/sys/dirent.h>

The last of these files then loaded <dirent.h> again. According to the blurb
in the file it should load any dirent.h that is lying around and should fail
if one can't be found. Of course since <dirent.h> was what started this off,
it is picked up again and the loop continues. I have removed the <dirent.h>
from the last file and the problem went away. This will do as a fix for my
problem but fix-header should probably be fixed so that this recursive issue
is tagged and some useful failure message printed so that anyone else
finding the problem gets a clue about what is happening. The easiest way of
doing this would be to put a check into scan_decls for the extern_C_braces
array being exceeded and then trigger a failure after printing some
information on the current file open.

I would produce a patch myself but I do not now enough about the code to
attempt such a thing. I don't know what else I might break.

Andy Hare
www.ahare.btinternet.co.uk

----- Original Message -----
From: "Neil Booth" <neil@daikokuya.demon.co.uk>
To: "Andy Hare" <ahare@btinternet.com>
Cc: "gcc-bugs" <gcc-bugs@gcc.gnu.org>
Sent: Wednesday, November 28, 2001 11:49 PM
Subject: Re: Problems compiling current CVS under cygwin.


> Andy Hare wrote:-
>
> > Neil,
> >
> >     Sorry, but the changes do not fix the problem. Here is the output
from
> > the 'fixed' version:
>
> [...]
>
> > Hope this helps.
>
> Sorry, it doesn't really.  I suspect you have a header infinite
> recursion where one header ends up #include-ing itself, probably
> indirectly.
>
> Neil.


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