This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: header search path change with 2003-03-02 commit
On Tue, Mar 25, 2003 at 06:44:20AM +0000, Neil Booth wrote:
> Can you explain why you avoid the sysroot stuff here (and also add it
> as a comment)?
Because Daniel wants it that way? :) I don't really have a good
reason, and if anything I'd say iprefix _should_ affect the sysroot
paths. ie. I think the first pass over the include dirs should do
if ((!p->cplusplus || cxx_stdinc)
&& !strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
{
char *str;
str = concat (iprefix, p->fname + len, NULL);
if (sysroot && p->add_sysroot)
str = concat (sysroot, str, NULL);
add_path (str, SYSTEM, p->cxx_aware);
}
That way iprefix affects the standard paths within the sysrooted
tree. Seems least surprising to me.
> Why should the iprefixed directories come first (again,
> please add a comment too)?
It's easy to see that each individual iprefix dir should come before
its untranslated dir. I can't explain why all the iprefix dirs should
come before any other dir, except that this was the behaviour prior
to Daniel's patch. Perhaps someone uses iprefix in combination with
#include_next.
>
> > if (len && !strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
> ^^^
> Please hoist this predicate to the level of if (ifprefix).
OK.
> How many of the paths in cpp_include_defaults can begin with
> cpp_GCC_INCLUDE_DIR? Can it be more than one?
I've seen two. $prefix/$target/sys-include and
$prefix/$target/include.
> If you can answer these questions I'm happy for it to go in.
Looks like I've hit the bar. :-(
--
Alan Modra
IBM OzLabs - Linux Technology Centre