Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!ncifcrf!lhc!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: vprintf() Message-ID: <13455@smoke.BRL.MIL> Date: 31 Jul 90 01:15:38 GMT References: <1990Jul28.211947.3795@zoo.toronto.edu> <13450@smoke.BRL.MIL> <1990Jul30.182656.19169@zoo.toronto.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 42 In article <1990Jul30.182656.19169@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article <13450@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >>>>Is vprintf() mandated to be in by ANSI C... >>>Yes. (Although you have to include as well.) >>You don't have to include to get vprintf() properly defined, >>just ... >Can you prove this? Unless this got changed since the late draft that >is all I've got (must get a copy of the final standard, sigh...), the >specs for the v* functions all call for before . >On a quick search, I find no explicit statement to the effect that >either (a) suffices, or (b) is required. 4.1.2.1 states that the header for the section (4.9, i.e. ) declares or defines all identifiers listed for its section; it doesn't say or imply that it may need any help in doing so. The "Synopsis" subsections are just a funny sort of pseudo-source method of showing what the function interfaces are like; in fact, as 4.1.6 points out, in most cases the functions can be declared without use of any standard header. The reason for in the v*printf() Synopses is that the interface is shown in terms of the va_list type, and inclusion of is the only method by which a strictly conforming application could get that type defined. Note, however, that a conforming implementation must NOT naively invoke to obtain a definition for va_list for use in the v*printf() declarations within . This was explained in the response to a letter in the third round of public review of the draft proposed standard: Response to Letter 185 (X3J11/88-145) issue summarized as "va_list must also be defined in stdio.h>": va_list need not, indeed must not, be defined in . typedefs do not create new types, merely synonyms for other types. In function prototypes an implementation has to use the type that it would define for va_list in . For example, if a void * is chosen for va_list, the prototype for vprintf, vfprintf, and vsprintf would just use void *. This question has come up several times, and that has always been the response.