This is the mail archive of the gcc@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]

Re: "changing search order...."


Phil Edwards wrote:
> 
> When did this get added?
2001-07-04  Nathan Sidwell  <nathan@codesourcery.com>

	* cppinit.c (remove_dup_dirs): Inform if a system include
        directory is being reordered.
see http://gcc.gnu.org/ml/gcc-patches/2001-07/msg00079.html

The warning is triggered when there are multiple paths to the same
system include directory, the classic example being someone giving
-I/usr/include. As you know, bad things happen then, especially with
fixincluded headers and header's using #include_next. Yes I know
the manual says 'don't do that', but I had the misfortune to build
an autoconf'd package that, by error, added -I/usr/include, and it
took some detective work to actually find out why that tool's build
failed in the way it did.

The current test warns when it finds a duplicate. A more sophisticated
test, which could eliminate warnings where the duplicates could
not affect anything was considered by me. Namely given a search order
	a b c baz bar foo baz
we detect the two baz's. If it so happens that foo == c && bar == b
(in both name|inode and systemness), then the multiple inclusion is
harmless. I rejected this test, as I still considered it a bomb
waiting to go off.

> cc1plus: warning: changing search order for system directory "/home/pme/build/install-2001-07-05/include/g++-v3"
> cc1plus: warning:   as it is the same as system directory "/home/pme/build/T/include/g++-v3"

> 'T' is a symlink to 'install-2001-07-05'.  The build was configured with a
> --prefix involving install-2001-07-05, but the g++ driver was called through
> the path involving T.
I think this is the above case, what are
	(a) the arguments to cc1plus
	(b) the output of cc1plus -v
?

> Are we intentionally trying to annoy people who use symlinks
Of course not, we're trying to help them :-)

>, or am I
> using a local setup which we've decided to deprecate?
I don't know.

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]