Article View: comp.std.c
Article #2747Re: Is va_list defined by <stdio.h>?
From: Stephen Clamage
Date: Fri, 12 Apr 1991 15:28
Date: Fri, 12 Apr 1991 15:28
32 lines
1724 bytes
1724 bytes
bhoughto@bishop.intel.com (Blair P. Houghton) writes:
>In article <15781@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes:
>>Many of the top C experts in the world disagreed with you.
>>I think the standard has this exactly right.
>Is there a good reason why v*printf() aren't declared in <stdarg.h>?
>The only one I can think of is an issue of categorization
>that seems to have overwhelmed one of usage.
>How could you use v*printf() without <stdarg.h>?
v*printf() aren't declared in <stdarg.h> because you would need to
declare FILE in it, and this would blow the modularity -- you would have
a type and functions declared whenever you used stdargs, even if you did
not want standard I/O. Remember, if you do not include <stdio.h> FILE
and v*printf are not reserved for use as local identifiers.
You cannot USE v*printf() without including <stdarg.h>, but you can
DECLARE them. Thus:
1. You may include <stdio.h> without <stdarg.h> if you do not need
v*printf().
2. You may include <stdarg.h> without <stdio.h> if you do not need
standard I/O.
3. You must include both headers if you want to use v*printf().
This seems like entirely reasonable modularity to me. You pay for
what you want to use.
--
Steve Clamage, TauMetric Corp, steve@taumet.com
Technical Details
Message-ID:
<667@taumet.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!taumet!steveReferences:
<11852@dog.ee.lbl.gov> <16965@hoptoad.uucp> <15781@smoke.brl.mil> <3769@inews.intel.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.std.c Subject: Re: Is va_list defined by <stdio.h>? Message-ID: <667@taumet.com> Date: 12 Apr 91 15:28:25 GMT References: <11852@dog.ee.lbl.gov> <16965@hoptoad.uucp> <15781@smoke.brl.mil> <3769@inews.intel.com> Organization: Taumetric Corporation, San Diego Lines: 32