<stdarg.h> (requires <stdio.h>?)

Steve Summit scs at adam.pika.mit.edu
Sun Apr 9 13:41:39 AEST 1989


The following fails to compile under Microsoft C version 5.1:

	#include <stdarg.h>

	warning(fmt)
	char *fmt;
	{
	va_list arg_ptr;
	va_start(arg_ptr, fmt);
	verror("warning", fmt, arg_ptr, 0);
	va_end(arg_ptr);
	}

because the va_end implementation sets arg_ptr to NULL, which
is nowhere defined.  This strikes me as a bug.  The synopsis
section of Microsoft's documentation for the va routines shows
<stdio.h> being #included (which would, of course, take care of
the problem), but I don't think I should have to.  What sayeth
the pANS?  I know it guarantees you can #include standard header
files multiple times (a desirable property), but does it ever say
you have to #include one before you can #include another?  (This
would not be desirable.)

                                            Steve Summit
                                            scs at adam.pika.mit.edu



More information about the Comp.std.c mailing list