va_list used in <stdio.h>

Dale Schumacher dal at midgard.Midgard.MN.ORG
Sat Aug 12 14:46:56 AEST 1989


I'm working on the header files for a PD LIBC implementation with the
goal that it be as close as possible to X3J11 and POSIX conformance.
I'm working from the May 13, 1988 draft of the C pANS.

In the <stdio.h> header file, the v[fs]printf() function prototypes
use the va_list type, but va_list is not defined anywhere in <stdio.h>.
The synopsis shows the need to #include both <stdarg.h> and <stdio.h>
in order to use v[fs]printf(), but what about #include'ing <stdio.h> in
a program which doesn't use these functions?  The prototype would then
be an error, right?  Also, section 4.1.2 (the v[fs]printf() functions
are in 4.9.6.[789]) states "Headers may be included in any order; ...".
In order for the declaration to work, <stdarg.h> must be #include'd first.
The standard also seems to imply that header files do not include each
other.  Is this the case?  Do I have an outdated draft of the standard?



More information about the Comp.lang.c mailing list