Re: linux-next: Tree for April 10 (arch/x86)

From: Al Viro
Date: Fri Apr 11 2008 - 11:27:20 EST


On Fri, Apr 11, 2008 at 08:19:01AM -0700, Randy Dunlap wrote:

> > It
> > is a totally uninteresting warning that we pass in a narrower type to
> > printk(). It cannot ever cause any bugs or problems. Why does gcc warn
> > about it?
>
> No idea about that part.

Er... That's kinda obvious - vararg function getting the wrong-sized
argument is *NOT* a harmless situation. And yes, it's certainly a bug -
gcc manages to recover by using the knowledge of printf() formats (i.e.
it guesses that we want a long long and does conversion), but try to
do
char *s = "%llx %c";
printf(s, 1, '.');
and watch the show...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/