This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC's order of header file search path
- From: Ian Lance Taylor <iant at google dot com>
- To: "Jeffi Edward.J" <j dot jeffi at yahoo dot co dot in>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 30 Oct 2009 08:55:25 -0700
- Subject: Re: GCC's order of header file search path
- References: <26125999.post@talk.nabble.com>
"Jeffi Edward.J" <j.jeffi@yahoo.co.in> writes:
> Diab C compiler
> always searches standard include paths before -I paths.
It does? That seems odd.
> I read in GCC manual that path given by -I will be searched first prior to
> the standard include path. So I'm getting lot of unnecessary errors.
>
> I tried to include GCC standard include path with -I option prior to
> remaining vendor specific -I paths. But GCC cleverly ignores the path which
> is standard system include directory.
>
> I want GCC to always search standard header path first prior to -I option.
>
> Is there any option to make GCC to behave so? Or Have I missed any option in
> GCC configuration while building?
There is no gcc option to tell it to search the standard include
directories before any of the -I option.
I'm not aware that gcc does anything clever about ignoring a patch for
the system include directory. If it does do that, perhaps you can
avoid it by using -nostdinc.
Ian