David Tiktin wrote, On 29/01/08 23:58:
Where I have looked at system headers they include other (often
private) headers. The standard does not say that a system header
cannot include another header, it says that it must behave as if
it does not include any of the other headers defined by the
standard.
Yes, I had a chance to look at Plauger last night and he does just
that. He has a file called _yvals.h which #defines _NULL and in
standard headers that have to #define NULL he does:
....
#include <_yvals.h>
....
#define NULL _NULL
So Plauger tries to stay DRY. But as fnegroni asks elsethread, why
aren't standard headers allowed to #include other standard headers? Is
it forbidden by the standard? If so, why? This seems especially hard
to understand for stdarg.h since stdio.h has prototypes which need to
include va_list arguments such as vprintf() and va_list is defined in
stdarg.h.
Plauger explains that one of the principle governing the design of the
standard headers is that they be independent of each other (which is
why they don't #include other standard headers). But I can't find the
exact reason *why* this is such an important principle. Can you
explain? Or maybe I should ask in comp.std.c?
Dave