[Off-Topic Code] Case Statements

From: David Eliott (ravemaniac@HOTMAIL.COM)
Date: 08/31/97


Look at this piece of code:
void blah(void)
{
  switch(arg) {
    case blah: return ??; break;
    case blah: return ??; break;
    case blah: return ??; break;
    default: return ??; break;
  }
}

Now, are those break statements needed? doesn't the function return,
stop the function? This is what my compiler would tell me with this
function:
Unreachable code in function blah(void)
Unreachable code in function blah(void)
Unreachable code in function blah(void)
Unreachable code in function blah(void)

For those 4 lines with the return; break;

Now is there a quick way to fix this?





______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


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