<varargs.h> vs. function prototypes

Scott D. Eberline scotte at locus.com
Thu Jun 13 08:43:53 AEST 1991


For software that may potentially be ported to platforms not yet
ANSI-compliant, some functions taking variable arguments are
defined using <varargs.h> instead of <stdarg.h>.  I would like
to declare full prototypes for these to avoid compiler warnings
about missing prototypes.  In the module in which these functions
are defined, this doesn't seem to be possible:

1.  prototypes using the ellipsis notation for variable argument lists 
don't match varargs-style function definitions;

2.  because of the built-in semicolon, prototypes can't contain va_dcl.

I'm a bit resigned to having missing prototype warnings for the module
that contains the function definitions.  I'd still like to have
prototypes in all the other modules, and the ellipsis notation
seems to be the only way to do this.

How dangerous is it to call functions declared externally using the
ellipsis notation, but defined using va_dcl?  May a conforming implement-
ation assume that functions with ellipsis prototypes use <stdarg.h>-style
arguments and not <varargs.h>-style?
-- 
Scott D. Eberline			scotte at locus.com  or  lcc!scotte



More information about the Comp.std.c mailing list