[Linux-ia64] gcc issue ?

From: Ram Menon <rmenon_at_informix.com>
Date: 2001-06-13 09:39:48
Hi,

Following program fails compilation on linux ia64 os, but works on 
other os's.

#include <stdarg.h>

main()
{

f(1, 'c', 10);
}

f(char a, ...)
{

int cval;
va_list     args;
va_start(args, a);

cval = va_arg(args, char);

}


[root@timba /root]# cc main.c -o main
main.c:10: warning: type mismatch with previous implicit declaration
main.c:6: warning: previous implicit declaration of `f'
main.c: In function `f':
main.c:16: `char' is promoted to `int' when passed through `...'
main.c:16: (so you should pass `int' not `char' to `va_arg')


Is va_arg(args, int) same as va_arg(args, char) for char arg ?.

thanks
Received on Tue Jun 12 16:40:31 2001

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:04 EST