Kernel prepatch 3.11-rc4
Kernel prepatch 3.11-rc4
Posted Aug 5, 2013 12:11 UTC (Mon) by error27 (subscriber, #8346)In reply to: Kernel prepatch 3.11-rc4 by NAR
Parent article: Kernel prepatch 3.11-rc4
These bugs are extremely rare since the compiler normally warns about them if you don't use the double parenthesis. Probably we get one or two of these per year in the kernel. Meanwhile Yoda code makes the code ugly and hides more bugs than it fixes. We don't write Yoda code in the kernel.
Along side the GCC warning I have a static checker that looks for bugs like:
if ((x = 10)) {
I will amend it to look for:
if ((x = &foo)) {
since that is obviously never false. Also this should trigger an unreachable code warning... Hm...
