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

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


On Thu, 19 Nov 1998, Paul Rusty Russell wrote:
>
> Reread patch; I'm not dropping it. Ignoring the `h' qualifier is the
> right thing to do except in the already-broken case of an actual int,
> eg:
>
> printk("%hu", 65536);

It's _never_ the right thing to do. It gets the sign wrong, for example,
and it shows undefined bits that aren't supposed to be showed. You have to
at least cast the argument correctly.

> I've been bitten years ago; nowadays I always pull the promoted type
> out of varargs. Seems I'm not alone.

Still sounds like a header/gcc buglet to me, but I can easily let it pass.
I don't see why varargs couldn't just do the right thing always, this
sounds like a "oh, we're too lazy to handle that case in the obviously
correct way" issue with the compiler or the standards people.

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/