variable number of arguments

Steve Hanson sah at mips.UUCP
Tue Aug 6 08:49:14 AEST 1985


One practice in C that is both deeply ingrained in UNIX (e.g. printf, doprnt.c)
and non-obvious to the reader are functions that take a variable number.
The method is to take the address of one of the formal parameters and
reference indirectly the others (which aren't explicit in the 
formal parameter declaration list). To help standardize the usage of this
practice the varargs.h macros were developed and now the proposed ANSI draft
includes the stdarg.h macros.  

My questions are:
  (1) Are these macros being used by developers ?
  (2) What is the reaction to them ?
  (3) Is old code modified to use them?
  (4) What is the effect when an optimizing compiler passes arguments 
      in registers? 
  (5) Do any implementations require the macros be used?



More information about the Comp.lang.c mailing list