Re: linux headers and C++

Ronnie G Misra (rgmisra@mit.edu)
Thu, 01 Jul 1999 17:58:39 EDT


root@chaos.analogic.com wrote:
> To make this more clear. Observe:
>
> switch(foo)
> {
> case 0:
> case 1:
> case 2:
> default:
> }
>
> This is basically a NOP. Perfectly legal (and useless).

Try compiling that code with "gcc -pedantic" and you will find that
this is not legal ANSI C. It is legal in gcc because it is a gcc
extension.

Try compiling with g++, and you will get a parse error.

Ronnie Misra rgmisra@mit.edu
3 Ames Street, Box 152
Cambridge, MA 02142
(617) 225-6365

-
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/