|#include what? DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-04-25)|
|Re: #include what? email@example.com (Russ Cox) (2006-04-26)|
|Re: #include what? firstname.lastname@example.org (Ian Lance Taylor) (2006-04-27)|
|Re: #include what? cfc@shell01.TheWorld.com (Chris F Clark) (2006-04-27)|
|Re: #include what? email@example.com (glen herrmannsfeldt) (2006-04-28)|
|Re: #include what? firstname.lastname@example.org (2006-04-28)|
|Re: #include what? cfc@shell01.TheWorld.com (Chris F Clark) (2006-04-30)|
|[1 later articles]|
|From:||Hans-Peter Diettrich <DrDiettrich@compuserve.de>|
|Date:||25 Apr 2006 10:14:01 -0400|
|Keywords:||C, standards, question|
|Posted-Date:||25 Apr 2006 10:14:01 EDT|
As the subject indicates, I'm confused about the searching strategy of
the C preprocessor. The use of the search path is clear to me, but
what about additional locations, like the "current" directory, the
directory of the including file, and the parent directories? Are these
locations extensions of the standard, or does there exist an agreement
about the additional locations to be searched?
What's the "current" directory? Is it a project specific setting, or
is it related to the currently compiled file(s)? I guess that
(typically) it could be the parent directory of the Makefile?
Also, which additional locations apply to patterns like "sys/xyz.h"?
What's the directory of such an file, when it #includes further files?
Is it the .../sys/ directory, or the directory containing the sys/
Or is such a pattern applicable only to system files, i.e. as
<sys/xyz.h>, so that only the includepath is searched? What about
The more I dig into the various specs, the more I'm confused :-(
[The C standards say that the interpretation of the <filename> or
"filename" in #include is entirely up to the implementation. My
impression is that the de-facto standard on Unix systems is whatever
cccp, the GCC preprocessor, does. -John]
Return to the
Search the comp.compilers archives again.