In message <> you 
> It turns out wrapping that last "case" in curly-braces makes everything
> happy and compileable...  Not that this is comfortable...

It's a less-than-good feature of C.  Case labels are labels,
and thus must label a statement.  My version of gcc gives
the helpful error message "error: a label can only be part
of a statement and a declaration is not a statement", which
pretty much summarizes the problem.  Ironically, sticking a
semicolon right after the colon in the case label makes it
label an empty statement, making the whole thing OK again.
Please don't do that. :-) In any case, as gcc says with
-ansi -pedantic, "warning: ISO C90 forbids mixed
declarations and code".  C99 does not, which is how it
should have been from day 1 in the C language.


psas-avionics mailing list

Reply via email to