Is va_list defined by <stdio.h>?

John Gilmore gnu at hoptoad.uucp
Wed Apr 10 09:09:25 AEST 1991


Thanks, Chris, for your useful response.  My confusion lie in the fact
that __VA_LIST__ is not #undef'd after use in <stdarg.h>, like all the
other names defined in <machine/ansi.h>.  I had a case where the user
had included

	#include <stdarg.h>
	#include <stdio.h>

and the compile was failing because __VA_LIST__ was undefined in stdio.h.

Either the conventions for the use of each name in <machine/ansi.h>
should be documented, or this unusual usage of __VA_LIST__ should be
changed to match all the rest, and perhaps a new __VA_LIST_STICKY__
introduced for <stdio.h> to depend on.

torek at elf.ee.lbl.gov (Chris Torek) wrote:
> This introduces two new problems: <stdio.h> is now machine dependent
> (an otherwise-unnecessary situation), and <stdarg.h> and <stdio.h> must
> somehow be kept in sync.

I believe that ANSI C should not have forced us to introduce these two
new problems.  In other words, this is a botch in the standard, that
should be fixed in its next revision.  Preferably the fix will simply
permit <stdio.h> to define va_list, or indeed, for it to include
<stdarg.h>, so that no backdoor monkeyshines at all would be needed.
-- 
John Gilmore   {sun,uunet,pyramid}!hoptoad!gnu   gnu at toad.com   gnu at cygnus.com
*  Truth :  the most deadly weapon ever discovered by humanity. Capable of   *
*  destroying entire perceptual sets, cultures, and realities. Outlawed by   *
*  all governments everywhere. Possession is normally punishable by death.   *
*      ..{amdahl|decwrl|octopus|pyramid|ucbvax}!avsd!childers at tycho          *



More information about the Comp.std.c mailing list