This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to cccp.c to display omitted default include directories
- To: law at cygnus dot com
- Subject: Re: Patch to cccp.c to display omitted default include directories
- From: Zack Weinberg <zack at rabi dot columbia dot edu>
- Date: Tue, 02 Mar 1999 09:10:00 -0500
- cc: egcs-patches at cygnus dot com
On Tue, 02 Mar 1999 01:40:51 -0700, Jeffrey A Law wrote:
>
> In message <199902232206.OAA20499@elmo.cygnus.com>you write:
> > Hi Guys,
> >
> > I would like to submit the following little patch which provided
> > some useful debugging information for when I was tracking down a
> > configuration problem. The patch extends the -v output of 'cpp' so
> > that it also lists the default include directories which were never
> > appended to the include directory chain.
> >
> > Cheers
> > Nick
> >
> >
> > Tue Feb 23 14:00:40 1999 Nick Clifton <nickc@cygnus.com>
> >
> > * cccp.c (struct default_include): Add 'included' field.
> > (main): Set 'included' field when a default include directory
> > is added to the chain. If -v is specified list all default
> > include directories which do not get appended to the chain.
>Can you do the same thing for cpplib?
cpplib's include-path handling code is completely different and Nick's
patch does not translate well. I added something similar in the patch
I posted last week ("cpplib: initialization overhaul"). That's
http://egcs.cygnus.com/ml/egcs-patches/1999-02/msg00728.html.
>It might make sense to have this conditional on a warning flag (a generic
>one, or a specific one would be fine by me).
If we put this on a warning flag, you'll get messages for every .c
file in a large build when a directory doesn't exist. Some of the
directories on the default include path may legitimately not exist
(e.g. /usr/local/include). I think -v is the right place.
>It might be good improve the warning to note why those directories did not
>get added to the chain (because they didn't exist? any other reason they
>would not get added?)
In cpplib, because they don't exist or because they are duplicates.
My patch differentiates. It'd be nice to drop empty directories too,
but there isn't a simple way to detect that as far as I know.
zw