Richard Heathfield said:
I don't agree that the implementation has such power of veto over the
machine, and I'd be interested to see your C&V.
It's not power over the machine, it's the implementation's power over
itself.
C99 6.10.2p2:
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.
A header, as I'm sure you'll agree, needn't be a file.
An implementation could search for <> headers in a single "place",
which could be a table of headers internal to the compiler. Or it
could just be a single directory, containing actual header files,
that's part of the implementation, with users of the implementation
not permitted to mess with that directory.
Thus an implementation could easily restrict the headers usable
with the <> syntax to a fixed set, consisting of the 24 standard
headers plus zero or more implementation-defined ones.
What part of the standard would such an implementation violate?
The standard neither defines nor implies any mechanism for a
programmer to create a header other than a header file, and does not
require #include <...> to be able to access headers that are files.
A strictly-conforming program "shall not produce output dependent
on any unspecified, undefined, or implementation-defined behavior"
(C99 4p5). Surely a program that contains the line
#include <myheader.h>
depends on the implementation-defined behavior of that directive.
From which I conclude that no strictly conforming program may contain
the line
#include <int128.h>
and therefore that a conforming implementation may define such a
header for its own purposes.
The alternative would require all conforming extensions to use
only identifiers in the implementation's namespace. Furthermore,
since there are no reserved header names other than the 24 standard
ones, no conforming implementation would be able to provide *any*
additional headers, since they would all intrude on the programmer's
namespace.
That's common convention and good practice, but I'm not convinced that
it's legislated.
Not directly, but I think the standard does imply, in effect, that
the standard can do what it likes with the #include <...> namespace;
since it's permitted to define what <...> means, it can define it
to refer to a place or places over which it has complete control.