lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 14 Apr 2008 09:22:20 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Randy Dunlap <randy.dunlap@...cle.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	mingo <mingo@...hat.com>, tglx <tglx@...utronix.de>,
	linux-next@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: linux-next: Tree for April 10 (arch/x86)

On Mon, Apr 14, 2008 at 10:12:20AM +0200, Ingo Molnar wrote:

> well, gcc does not "recover", we _gave_ it the format string as a 
> constant, and do so in 99.9% of the cases. It is a totally 
> well-specified thing.

It is an undefined behaviour according to any variant of C standard.
Sorry, printf() is not magic and it does _not_ have special calling
conventions.

> but the constant noise from gcc about printf formats, where the 
> conversion is very clear and could be done implicitly, only hinders us 
> and only teaches people to _ignore_ gcc warnings - which is actually 
> very dangerous.
> 
> the only warning from gcc in this area should be where the format 
> results in information _loss_ (i.e. the format has a narrower type than 
> we pass into it) - there a warning is very much needed - and the 
> programmer should then fix the bug or add a cast.

No, sorry.  That kind of mismatch is simply not a valid C.  Plain as that,
read the standard and you'll see.

Fundamentally, printf() is a function like any other vararg one.  So
explicitly typed arguments *are* the right thing to do.

What is not right is the lack of ability to define new conversions.  If
we could do that, we would kill the absolute majority of casts - and
remain within normal C limits...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ