lkml.org 
[lkml]   [2000]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:1.148 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site