Skip to content

Instantly share code, notes, and snippets.

@d0k
Created February 22, 2014 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d0k/9155394 to your computer and use it in GitHub Desktop.
Save d0k/9155394 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
enum E { A, B };
int foo(enum E x) {
switch (x) {
case A:
return 42;
case B:
return 23;
}
abort();
// defensive.c:11:3: warning: will never be executed [-Wunreachable-code]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment