Is va_list defined by <stdio.h>?
John Gilmore
gnu at hoptoad.uucp
Sat Apr 6 07:47:08 AEST 1991
In an ANSI C implementation, it appears that the type "va_list" must be
defined by <stdio.h> because it it used to declare the arguments for
vfprintf, vprintf, and vsprintf. However, it is not in the list of
types declared by <stdio.h>, either in Appendix C.10 (page 192) or
in section 4.9.1 (page 125).
The sections that document these particular vXXX functions say, e.g.:
#include <stdarg.h>
#include <stdio.h>
int vsprintf(char *s, const char *format, va_list arg);
but it is not possible for <stdio.h> to declare these functions without
also declaring va_list, since some people will include <stdio.h> without
including <stdarg.h>. <stdio.h> could avoid declaring these functions
if <stdarg.h> was not also included, but the includes could occur in either
order, making things very messy, and I don't think that's what the standards
committee had in mind.
Is this a real omission, or am I missing something?
--
John Gilmore {sun,uunet,pyramid}!hoptoad!gnu gnu at toad.com gnu at cygnus.com
* Truth : the most deadly weapon ever discovered by humanity. Capable of *
* destroying entire perceptual sets, cultures, and realities. Outlawed by *
* all governments everywhere. Possession is normally punishable by death. *
* ..{amdahl|decwrl|octopus|pyramid|ucbvax}!avsd!childers at tycho *
More information about the Comp.std.c
mailing list