Variable argument lists.

Karl Heuer karl at haddock.ISC.COM
Sat May 14 04:23:51 AEST 1988


In article <300 at teletron.UUCP> andrew at teletron.UUCP (Andrew Scott) writes:
>In article <3080 at teklds.TEK.COM>, daniels at teklds.TEK.COM (Scott Daniels) writes:
>>[C allows a function to be called with extra arguments, which are ignored]
>
>Is this true, or just a fluke thing that works under many C implementations?

It's a fluke.  (It doesn't always work, even in UNIX implementations.)  In
ANSI C, it's definitely illegal for nonvariadic functions, and explicitly
legal for the printf/scanf families.  The properties of <stdarg.h> seem to
imply that it would also be legal for any user-supplied variadic function.
That leaves non-standard vendor-supplied variadic functions, such as execl; my
guess is that it's the vendor's responsibility to document the domain.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list