types of optional arguments in stdarg.h

Ray Butterworth rbutterworth at watmath.waterloo.edu
Wed Sep 7 00:04:41 AEST 1988


In article <1067 at xyzzy.UUCP>, meissner at xyzzy.UUCP (Michael Meissner) writes:
> Let me mention something that came
> up in our discussion:  Namely that it is desirable that you have two
> different forms of this, one for the times that you want the comma supplied
> if there are extra arguments, and the other for times when you don't want
> the comma.  Otherwise you could get compilation errors if no extra arguments
> were passed.

That reminds me of something I'd like to see as an extension
to the variable argument prototypes in some future version
of the Standard.

extern void func(type1, type2, ...);  /* usual meaning */

extern void func(type1, type2  ...);
                             ^
                             No comma.
The missing comma would indicate that all the optional "..." args
must have the same type as the second argument.



More information about the Comp.std.c mailing list