variable # of args portability?

VLD/VMB gwyn at BRL.ARPA
Tue Jul 8 12:02:54 AEST 1986


Most UNIX and some other C implementations have a <varargs.h>
header file that defines macros for getting at variably-sized
argument lists; unfortunately this is not sufficient for an
interface to a printf-like routine, where you need to pass
the remaining argument list along.  Many UNIX and some other C
implementations provide v*printf functions that are useful
in such situations.  There is normally some function like
_doprnt in the C library, but it may go by another name and
have slightly different arguments.

For the time being, people usually either invoke *printf using
functions with fixed arguments (perhaps several of them to
cover all necessary cases) or provide an interface that must
be adapted by each site.  Other commonly-used approaches tend
to be non-portable.



More information about the Comp.lang.c mailing list