This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/5128: Include Flag Order Not Followed
- From: Andreas Jaeger <aj at suse dot de>
- To: David Highley <dhighley at highley-recommended dot com>
- Cc: nathan at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org,nobody at gcc dot gnu dot org
- Date: Fri, 04 Jan 2002 17:03:50 +0100
- Subject: Re: c/5128: Include Flag Order Not Followed
- References: <200201041435.g04EZtaA005850@hemlock.highley-recommended.com>
David Highley <dhighley@highley-recommended.com> writes:
> "nathan@gcc.gnu.org wrote:"
>>
>> Synopsis: Include Flag Order Not Followed
>>
>> State-Changed-From-To: analyzed->closed
>> State-Changed-By: nathan
>> State-Changed-When: Fri Jan 4 01:34:05 2002
>> State-Changed-Why:
>> Not a bug. For files #included like
>> #include "s.h"
>> the search path is
>> 1) the directory containing the including file
>> 2) the user search path
>> 3) the system search path
>>
>> For those #included with <s.h> that first lookup
>> is omitted.
>
> Where is this documented? Is it part of the language specification or
> one of the wholes left for compiler implementors to make decisions
> about?
cpp.texi and therefore the gcc manual contains:
@findex #include
Both user and system header files are included using the preprocessing
directive @samp{#include}. It has two variants:
@table @code
@item #include <@var{file}>
This variant is used for system header files. It searches for a file
named @var{file} in a standard list of system directories. You can prepend
directories to this list with the @option{-I} option (@pxref{Invocation}).
@item #include "@var{file}"
This variant is used for header files of your own program. It searches
for a file named @var{file} first in the directory containing the
current file, then in the same directories used for @code{<@var{file}>}.
@end table
[...]
ISO C defines this as implementation defined but makes a difference
between them.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj