Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!mailrus!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Does stdio.h require stdargs.h? Message-ID: <11691@smoke.BRL.MIL> Date: 27 Nov 89 20:53:47 GMT References: <3032@ibmpa.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 19 In article <3032@ibmpa.UUCP> lmb@ibmsupt.UUCP (Larry Breed) writes: >The Standard's synopsis of vprintf is -- > #include > #include > int vprintf(const char *format, va_list arg); >Presumably stdio.h contains the prototype declaration for vprintf. >But without stdarg.h, va_list is undefined. This seems to require >anyone who includes stdio.h to include stdarg.h as well. >Have I missed something? Hi, Larry. Gee, we seem to have this same question or an analogous one every couple of months. The answer is that the application need include only . It is up to the implementation to make this work. The usual implementation technique is to supply the proper type in place of "va_list" in the prototype inside . Because typedefs do not create separate types but merely serve as shorthand for ones that could be specified in "raw C", it is always possible to avoid using defined types -- assuming you know the correct equivalent, as the implementor must.