Article View: comp.std.c
Article #6103Re: varargs vs. prototypes
From: Doug Gwyn
Date: Thu, 08 Jun 1989 20:08
Date: Thu, 08 Jun 1989 20:08
18 lines
1260 bytes
1260 bytes
In article <237@pink.ACA.MCC.COM> rfg@MCC.COM (Ron Guilmette) writes:
>Old (non-prototype) function declarations & definitions have
>been depreciated right? So we really should *not* be using
>the old style anymore right? We should do everything with
>prototypes right?
If you don't care about non standard-conforming implementations,
then you should use prototypes. Otherwise, you should use the
__STDC__ predefined macro to select whether to use prototypes or
old-style declarations. Some clever tricks to assist in this
have been previously posted, but you can do it the obvious way..
>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> */ }
Technical Details
Message-ID:
<10380@smoke.BRL.MIL>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ukma!uflorida!haven!adm!smoke!gwynReferences:
<237@pink.ACA.MCC.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ukma!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: varargs vs. prototypes Message-ID: <10380@smoke.BRL.MIL> Date: 8 Jun 89 20:08:58 GMT References: <237@pink.ACA.MCC.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18