stdarg.h mostly broken

Chris Anderson chrisa at beldar.ma30.bull.com
Tue Mar 26 04:39:53 AEST 1991


The following program prints "0" when compiled on a 4D20:

	#include <stdarg.h>
	main() { foo(1); }
		
	foo(x) {
		va_list ap;
		va_start(ap, x);
		printf("%d\n", va_arg(ap, int));
	       }

However, if the "x" argument name is changed to "va_alist", then
it prints "1", which is clearly the right answer.

Do I detect a slight bias towards varargs.h here? :-)



--

 ______________________________.
/_____________________________/|
|     Chris Anderson          ||
| chrisa at beldar.ma30.bull.com ||
|_____________________________|/



More information about the Comp.sys.sgi mailing list