🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #6107

Re: varargs vs. prototypes

#6107
From: Ron Guilmette
Date: Fri, 09 Jun 1989 21:27
32 lines
1735 bytes
In article <10380@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes:
>In article <237@pink.ACA.MCC.COM> rfg@MCC.COM (Ron Guilmette) writes:
>>So how can I write a function definition for a varargs function
>>using prototypes?  Is this possible?
>
>#include <stdarg.h>
>ret_type func_name( type1 fixed_arg1, typen fixed_argn, ... )
>	{ /* stuff using the va_* macros defined by <stdarg.h> */ }


PLEASE!  EVERYONE!  I goofed!  Please don't send me anymore messages
showing me how to do this.  I know how to use prototypes and the
stuff from <stdarg.h> (or <varargs.h>) to get at the variable parameters.
I goofed because I asked the WRONG question.

The question I meant to ask was "How can you use prototypes for a function
which can accept ZERO or more arguments?"

There appears to be NO WAY to do this.

Since I asked the original question, I been informed that I should not
even be worring about the "ZERO or more" case because, in actual practice,
it never occurs.

I'm now mostly convinced that this is true, so my (intended) question is
moot.

-- 
// Ron Guilmette  -  MCC  -  Experimental Systems Kit Project
// 3500 West Balcones Center Drive,  Austin, TX  78759  -  (512)338-3740
// ARPA: rfg@mcc.com
// UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg
Technical Details
Message-ID: <245@pink.ACA.MCC.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!pp!pink!rfg
References: <237@pink.ACA.MCC.COM> <10380@smoke.BRL.MIL>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!pp!pink!rfg
From: rfg@pink.ACA.MCC.COM (Ron Guilmette)
Newsgroups: comp.std.c
Subject: Re: varargs vs. prototypes
Message-ID: <245@pink.ACA.MCC.COM>
Date: 9 Jun 89 21:27:46 GMT
References: <237@pink.ACA.MCC.COM> <10380@smoke.BRL.MIL>
Reply-To: rfg@pink.aca.mcc.com.UUCP (Ron Guilmette)
Organization: MCC  Austin, Texas
Lines: 32