Re: question about switch, return, break and off topic

From: Davies, Nathan (DaviesN@AECL.CA)
Date: 12/19/97


>
>The break really isn't needed there because of the return statement, but
>some compilers will scream and shout if the break isn't there because
>according to the standards it has to be there.

What???  If a compiler even flagged that as a warning, it should be sent
back to it's manufacturer...sorry if this sounds like a flame cuz it's
not...a break is a simple goto/jmp command and does not need to be
there...And there's nothing wrong with that...I like some cheese with my
spaghetti :)  Seriously...I use the case statement all the time for this
stuff...like if you have 10 possible entries for a value, and each needs
to execute a mutually exclusive line of code, along with the numbers
below/above it, case (number) case 10: do this; case 9: do that; case 8:
do doo; etc worx great for this...anyways...I'm long winded and i'll
shuddap now...

Funny...The original post was about a break that was after a return in
case statement that flagged a warning for unreachable code( or so I
thought that was the original message ).  This of course makes sense,
because the break couldn't ever be reached...hence the unreachable code
warning...see the loop...:)

>Nathan Davies,


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST