public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: <yann@linuxconsole.org>
To: Ian Lance Taylor <iant@google.com>
Cc: <gcc-help@gcc.gnu.org>
Subject: Re: Question about include path
Date: Thu, 03 Feb 2011 14:31:00 -0000	[thread overview]
Message-ID: <3069ceb8fa5b805f25ec092921b97c4b@localhost> (raw)
In-Reply-To: <mcroc6vleq2.fsf@google.com>

into gcc/incpath.c  :

into remove_duplicates :

/LFS2011/include is removed because "it is a non-system directory that
duplicates a system directory"

Then the search order is :

 /LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include
 /LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include-fixed
 /LFS2011/include
 /usr/include

the problem is that a "limits.h" is into 
/LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include-fixed/

The "-I" option should not overwrite search order (and put
/LFS2011/include as first directory) ?

Thanks very much

Yann Le Doaré.


On Tue, 01 Feb 2011 11:47:01 -0800, Ian Lance Taylor <iant@google.com>
wrote:
> <yann@linuxconsole.org> writes:
> 
>> I build gcc (4.5.2) from scratch, and i have a question with include
>> path.
>>
>> when i want to include "limits.h" (the good one is at
>> /LFS2011/include/limits.h), gcc uses
>> /LFS2011/bin/../lib/gcc/i686-pc-linux-gnu/4.5.1/include-fixed/limits.h
>>
>> When i add "-I/LFS2011/include" it does not look for
>> /LFS2011/include/limits.h (bad ?) but when I add "-I/tmp", it looks
>> for /tmp/limits.h (good)
>>
>> What is wrong, where can i look into gcc source code to debug it ?
> 
> The code in question is in the libcpp directory and in gcc/cppdefault.c.
> However, this seems like an unlikely scenario.  Are you sure that the
> directory /LFS2011/include exists?  Also, use the -v option to see the
> exact search path that gcc will use.
> 
> Ian

  reply	other threads:[~2011-02-03 14:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 10:13 yann
2011-02-01 19:47 ` Ian Lance Taylor
2011-02-03 14:31   ` yann [this message]
2011-02-03 18:23     ` Jonathan Wakely
2011-02-04 10:47       ` yann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3069ceb8fa5b805f25ec092921b97c4b@localhost \
    --to=yann@linuxconsole.org \
    --cc=gcc-help@gcc.gnu.org \
    --cc=iant@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).