In message <8f5d905c0904091948y526182edm16cb2bf4d5a42...@mail.gmail.com> you 
wrote:
> 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.

     Bart

_______________________________________________
psas-avionics mailing list
psas-avionics@lists.psas.pdx.edu
http://lists.psas.pdx.edu/mailman/listinfo/psas-avionics

Reply via email to