On Wed, 18 Nov 1998, R Shapiro wrote:
> Linus Torvalds writes:
> > it (ie instead of using
> > num = va_arg(args, short);
> > it might be proper to use
> > num = (short) va_args(args, int);
However, I also suspect that the first version really _should_ work, and
that it really is a problem in gcc or the varargs header files that makes
it not work.
Alternatively, I'd really like to know whether maybe the C standard really
says that you _have_ to use the second form. It's possible it does.
Reading section 188.8.131.52 of the ANSI C standard (/word/ corresponds to
/type/ va_arg (va_list ap, /type/)
...if /type/ is not compatible with the type of the actual next
argument (as promoted according to the default argument
promotions), the behavior is undefined.
Section 184.108.40.206 defines compatible types:
Two types have /compatible types/ if their types are the same...
There are additional rules for compatibility but none apply in this
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
Please read the FAQ at http://www.tux.org/lkml/