This is the mail archive of the gcc-patches@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: PATCH: cpp include directory search order warning


Zack Weinberg wrote:
> 
> On Wed, Aug 07, 2002 at 12:48:48PM -0400, John David Anglin wrote:
> > Here is a fix for the problems noted in this thread:
> >
> > [warn only when -v]

> The original patch introducing this warning was written by Nathan
> Sidwell.  I would like to get his input.  Last time I tried to contact
> him on this, the mail bounced; here's trying again.
Sorry, I've stopped being Tigger now. I implemented that patch
as I got very confused trying to figure out why some system I was
building something on was malfunctioning. I can't recall if
/usr/include or <prefix>/include was involved.

> Note the intent of the autoconf macro in putting the -I option on the
> command line.  Not to tweak the search order - just to make sure that
> package headers get found.  This raises an alternate possibility for
> solving the problem: When we see -I <dir> where <dir> is already on
> the default include path, ignore the -I option (give notice of this
> under -v).  If the default include path is suppressed by -nostdinc,
> then this naturally does not happen.
I think this solution is almost equivalent to David's patch, but has
a different failure mode.
1) both fixes will only give you information under -v
2) David's patch will change a system dir to a non system dir, and
break any include_nexts that rely on the builtin ordering
3) Zack's (yet to be written) patch will give you a search order
(that might be) different to what you asked for, but does fulfil the
spirit, in that the directory will be searched.

Zack's solution seems safer.

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org


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