> On Thu, Jul 01, 1999 at 08:32:00PM -0400, Richard B. Johnson wrote:
> >
> > Yes. You are correct. I tried it with several 'non-gcc, non-unix'
> > compilers and they seem to require that a switch include at least
> > one statement within it. A ';' will suffice. I don't know if this
> > is really ANSI, someone else will probably comment.
> >
> > FYI lint finds nothing wrong with it. Further {} seems to be okay
> > as well as {;}, so I can't guess what rule is being violated.
> >
>
> A label has to be attached to a statement. A ';' on its own is a statement, as
> is {} or {;}. Whitespace is *not* a statement, but a compound statement can have
> an empty set of substatements, so {} is fine.
>
> -- arvind
>
> p.s. I deserve to get flamed for commenting on ANSI C without having a copy of
> the standard in front of me, but here goes anyway.
>
No flames here. Sounds good to me. The label needing to be attached to
a statement seems true.
void func()
{
goto foo;
.......;
.......;
foo:
}
..... does not work. However
void func()
{
goto foo;
.......;
.......;
foo: return;
}
.... does work.
Which is inconsistant because running off the end of a void function
implies a 'return'. -- which means that the label is attached to a
statement in both cases (one implied, one explicit).
Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.2.6 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
-
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/