calling one varargs routine from another (how?!)

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Oct 28 07:08:20 AEST 1989


In article <21293 at adm.BRL.MIL> mark at spider.co.uk (Mark Valentine) writes:
-Q:  Is there a portable way, both in ANSI and traditional C, to call a
-    varargs function such as
-	void error(char *message, ...)
-    from another such as
-	void fatal(char *message, ...)

No, the best you can do is for the called function to accept a va_list
parameter that the caller initializes via va_start() from its own list.
Even then, I've heard of implementations that would do the wrong thing.



More information about the Comp.unix.wizards mailing list