« Return to Thread: GCC's order of header file search path

Re: GCC's order of header file search path

by Jeffi Edward.J :: Rate this Message:

| View in Thread


Sorry. Diab C behaves in the same way as GCC.
The problem which I faced is different. Sorry for the confusion.

Ian Lance Taylor-3 wrote:
"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

 « Return to Thread: GCC's order of header file search path