Re: [PATCH] Re: [ipchains] logging tcp/udp port numbers

Linus Torvalds (torvalds@transmeta.com)
Thu, 19 Nov 1998 09:51:06 -0800 (PST)


On Thu, 19 Nov 1998, Mikael Pettersson wrote:
>
> It is not difficult to imagine at least two ways in which the first, buggy,
> form "va_arg(args, short)" can misbehave: using a "short*" pointer to access
> an "int", and incrementing the variable argument list "pointer" as if the
> argument was "short" instead of "int".

Well, the argument against that is that va_args _shouldn't_do_that_then_.

va_args() is a compiler specific thing anyway, and as such it would not be
problematic to just make it do the right thing.

I've changed the Linux kernel to do what the standard obviously says has
to be done, but I'm just grumbling about a _stupid_ standard. va_args()
should _know_ that short is promoted and do the right thing.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/