Re: #include behavior (was: Automatically generate variables)



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

.



Relevant Pages

  • Re: Q: Newbee: #include "*.h" - What happened to <>
    ... > The last line differ from the rest? ... you're running a typical desktop system) <header> probably means ... searches a sequence of implementation-defined places for a header ... identified uniquely by the specified sequence between the ...
    (comp.lang.c)
  • Re: #include behavior
    ... possibility to place a source file into some place. ... a header identified uniquely by the specified sequence between the ... system in compiled program, not what compiler does. ...
    (comp.lang.c)
  • Re: Macro triggered by an event
    ... dialog when you click the check box that it has a header or it doesn't. ... will have the hightest sequence number, ... I cut and pasted your code as you said only when the macro fires it does ... 'This is worksheet event code, which means that it needs to be ...
    (microsoft.public.excel.programming)
  • Re: Importing a file
    ... Does you text data have some kind of Sequence number? ... 'read and process header ... imported header in a "Fixed Width" format. ... The file will vary in lenght (which I have code to compensate for multiple ...
    (microsoft.public.excel.programming)
  • Re: Hello
    ... VR of this tag and "00 E0" has to be the length of the value that ... sequence of items, where sequence and item have unknown length. ... The delimiters look like tags and have a lengh as well. ...
    (comp.protocols.dicom)