In message <[EMAIL PROTECTED]> Nate Williams writes:
: > [3] The ANSI C standard, at least, contains the requirement that each
: > individual system include file specified by that standard should
: > be usable all by itself, without the programmer being required to
: > explicitly include any OTHER system include files, prior to the one
: > he/she is actually interested in using.
:
: Can you quote me chapter and verse for this? I don't believe this to be
: true, and in truth, I believe this is completely wrong.
I don't think he can. The only requirements that it has are that some
header files not pull other header files in to define certain things.
NULL can be defined in a number of different places, for example, but
if you include stdlib.h or stddef.h for it, you don't get stdio.h.
This is explained in more detail in section 7.1.1.4 of the August 3,
1998 committee draft:
7.1.1 Library 7.1.2
...
[#2] The standard headers are
<assert.h> <inttypes.h> <signal.h> <stdlib.h>
<complex.h> <iso646.h> <stdarg.h> <string.h>
<ctype.h> <limits.h> <stdbool.h> <tgmath.h>
<errno.h> <locale.h> <stddef.h> <time.h>
<fenv.h> <math.h> <stdint.h> <wchar.h>
<float.h> <setjmp.h> <stdio.h> <wctype.h>
...
[#4] Standard headers may be included in any order; each may
be included more than once in a given scope, with no effect
different from being included only once, except that the
effect of including <assert.h> depends on the definition of
NDEBUG (see 7.2). [...]
However, if an identifier is declared
or defined in more than one header, the second and
subsequent associated headers may be included after the
initial reference to the identifier.[...]
...
Notice that these are for the *STANDARD* header files not the *SYSTEM*
header files. This is much different than having sys/mublefoo.h
depending on sys/types.h being included first.
Warner
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message