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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Molnar
Date: Monday, April 14, 2008 - 1:12 am

* Al Viro <viro@ZenIV.linux.org.uk> 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.

so yes, this warning is bogus.

You are right that passing in a non-constant string to printf is 
inherently dangerous though, and i'd suggest we warn about _that_ very 
prominently.

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.

	Ingo
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
linux-next: Tree for April 10, Stephen Rothwell, (Thu Apr 10, 1:14 am)
Re: [BUG] linux-next: Tree for April 10 - kernel panic whi ..., Bartlomiej Zolnierki ..., (Thu Apr 10, 5:03 am)
Re: [BUG] linux-next: Tree for April 10 - kernel panic whi ..., Bartlomiej Zolnierki ..., (Thu Apr 10, 10:14 am)
Re: linux-next: Tree for April 10, Greg KH, (Thu Apr 10, 10:42 am)
[BUG] linux-next: April 10 - kernel oops at kmem_cache_a ..., Kamalesh Babulal, (Thu Apr 10, 11:07 am)
Re: [BUG] linux-next: Tree for April 10 - kernel panic whi ..., Kamalesh Babulal, (Thu Apr 10, 11:25 am)
Re: [BUG] linux-next: Tree for April 10 - kernel panic whi ..., Bartlomiej Zolnierki ..., (Thu Apr 10, 12:16 pm)
Re: linux-next: Tree for April 10: generic pci_enable_reso ..., Mariusz Kozlowski, (Thu Apr 10, 12:34 pm)
Re: linux-next: Tree for April 10 (ftrace), Randy Dunlap, (Thu Apr 10, 3:07 pm)
Re: linux-next: Tree for April 10 (arch/x86), Randy Dunlap, (Thu Apr 10, 3:09 pm)
Re: linux-next: Tree for April 10 (arch/x86), Ingo Molnar, (Fri Apr 11, 12:46 am)
Re: linux-next: Tree for April 10 (arch/x86), Randy Dunlap, (Fri Apr 11, 8:19 am)
Re: linux-next: Tree for April 10 (arch/x86), Al Viro, (Fri Apr 11, 8:26 am)
Re: linux-next: Tree for April 10 (arch/x86), Ingo Molnar, (Mon Apr 14, 1:12 am)
Re: linux-next: Tree for April 10 (arch/x86), Al Viro, (Mon Apr 14, 1:22 am)
Re: linux-next: Tree for April 10 (arch/x86), Ingo Molnar, (Mon Apr 14, 1:34 am)
Re: linux-next: Tree for April 10 (arch/x86), Jakub Jelinek, (Mon Apr 14, 1:40 am)
Re: linux-next: Tree for April 10 (arch/x86), Jakub Jelinek, (Mon Apr 14, 1:43 am)
Re: linux-next: Tree for April 10 (arch/x86), Al Viro, (Mon Apr 14, 2:30 am)
Re: linux-next: Tree for April 10 (arch/x86), David Miller, (Mon Apr 14, 2:37 am)
Re: [BUG] linux-next: April 10 - kernel oops at kmem_cac ..., Kamalesh Babulal, (Mon Apr 14, 6:14 am)
Re: linux-next: Tree for April 10 (arch/x86), Randy Dunlap, (Mon Apr 14, 3:28 pm)