Re: #include behavior (was: Automatically generate variables)
- From: Beej Jorgensen <beej@xxxxxxx>
- Date: Fri, 23 Feb 2007 21:52:17 +0100 (CET)
In article <lntzxcabmx.fsf@xxxxxxxxxxxxxxx>,
Keith Thompson <kst-u@xxxxxxx> wrote:
7.1.2 paragraph 3:
If a file with the same name as one of the above < and > delimited
sequences, not provided as part of the implementation, is placed in
any of the standard places that are searched for included source
files, the behavior is undefined.
Interesting. That says that if I place a "stdlib.h" file in one of
the places searched for a
#include "stdlib.h"
directive but *not* for a
#include <stdlib.h>
Hmmm. That wasn't my read... Elaborate.
Why not for <stdlib.h>, especially since "" is a "superset" (so to
speak) of <>?
6.10.2p2 says:
A preprocessing directive of the form
#include <h-char-sequence> new-line
searches a sequence of implementation-defined places for a header
identified uniquely by the specified sequence between the < and >
delimiters, and causes the replacement of that directive by the
entire contents of the header. How the places are specified or the
header identified is implementation-defined.
(Emphasis on the verb "search".)
The sketchiest part seems to me to be what is meant by "standard places"
in 7.1.2p3. I can only assume that is another way of saying
the "implementation-defined places" of 6.10.2p2 (<>). p3 ("") says the
file is searched for in an "implementation-defined manner" devolving to
the rules of p2, but makes no reference to "place".
-Beej
.
- Follow-Ups:
- Re: #include behavior (was: Automatically generate variables)
- From: Keith Thompson
- Re: #include behavior (was: Automatically generate variables)
- References:
- Re: Automatically generate variables
- From: Mark McIntyre
- Re: Automatically generate variables
- From: Mark McIntyre
- Re: Automatically generate variables
- From: Beej Jorgensen
- Re: Automatically generate variables
- From: Keith Thompson
- Re: Automatically generate variables
- Prev by Date: Re: Better free(invalid pointer) behavior?
- Next by Date: Re: print 1 to n without any conditional statement, loop or jump.
- Previous by thread: Re: Automatically generate variables
- Next by thread: Re: #include behavior (was: Automatically generate variables)
- Index(es):
Relevant Pages
|