This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c/5128: Include Flag Order Not Followed


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]