Messages in this thread | | | Date | Wed, 23 Feb 2000 19:48:58 +0100 | From | Jamie Lokier <> | Subject | Re: Kernel bugs found using inspect tool |
| |
Ricky Beam wrote: > On Wed, 23 Feb 2000, Jamie Lokier wrote: > >Those are obvious GCC warning material. for/while/if followed by > >semicolon followed by brace. > > > >Hmm. When GCC supports column numbers, maybe warnings could be added > >ased on indentation clues too, like this which I've seen in the kernel > >on occasion: > > > > if (foo); > > bar; > > Those are perfectly legal constructions. The compiler, while certainly > magic, isn't a psychic.
Yes they are legal. And in every case where I've seen them, they're a mistake. The semicolon ones are good at being invisible too. I've done it and spent hours not seeing the semicolon in my code. Of course it's easy to see in someone else's code... :-)
And yes, I've seen kernel patches fixing these bugs from time to time.
That's why we have warnings. If the compiler knew they were illegal constructions, they'd be errors...
have a nice day, -- Jamie
- 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/
| |