Re: [PATCH] More compile warning fixes for 2.4.0

From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue Jan 09 2001 - 13:51:23 EST


On Tue, 9 Jan 2001, Albert D. Cahalan wrote:

> [about labels w/o statements after them]
>
> >> Is this really a kernel bug? This is common idiom in C, so gcc
> >> shouldn't warn about it. If it does, it is a bug in gcc IMHO.
> >
> > No, it is not a common idiom in C. It has _never_ been valid C.
> >
> > GCC originally allowed it due to a mistake in the grammar; we
> > now warn for it. Fix your source.
>
> Since neither -ansi nor -std=foo was specified, gcc should just
> shut up and be happy. Consider this as another GNU extension.

No, it was a gcc bug that gcc accepted the syntax in the first place.

Let the gcc people fix the bugs they find without complaining about them.
After all, gcc would have been perfectly correct in signalling this as a
syntax error, and aborted compilation. The fact that gcc only warns about
it is a sign of grace - it's not as if it is a _useful_ extension that
gives the programmer anything new and should be left in for that reason.

We'll fix up the kernel. That's where the bug is.

                Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 15 2001 - 21:00:22 EST