[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-tech
Subject:    varargs and the alpha
From:       Marco S Hyman <marc () snafu ! org>
Date:       1998-07-29 0:50:34
[Download RAW message or body]

The screen configure script runs this program to determine if
varargs.h should be used.

	#include <stdio.h>
	int main() { return 0; }
	int t() { vsprintf(0,0,0);; return 0; }

On a sparc and an i386 the program compiles without error.  However,
on the alpha:

	alpha:1$ cc x.c
	x.c: In function `t':
	x.c:3: incompatible type for argument 3 of `vsprintf'

Stdio defines argument 3 as _BSD_VA_LIST_.  This is a char* on the
i386 but a __va_list (a struct) on the alpha.  A possible solution
is to change the test program to:

	#include <stdio.h>
	#include <machine/ansi.h>
	#include <machine/stdarg.h>
	int main() { return 0; }
	int t() { va_list valist; vsprintf(0,0,valist);; return 0; }

Is there a better solution?

// marc

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic