title: Using enum type in a switch statement
body: <p>I am using a switch statement to return from my main function early if some special case is detected. The special cases are encoded using an enum type, as shown below.</p>
  
  <pre><code>typedef enum {
      NEG_INF,
      ZERO,
      POS_INF,
      NOT_SPECIAL
  } extrema;
  
  int main(){
  
      // ...
  
      extrema check = POS_INF;
  
      switch(check){
          NEG_INF: printf("neg inf"); return 1;
          ZERO: printf("zero"); return 2;
          POS_INF: printf("pos inf"); return 3;
          default: printf("not special"); break;
      }
  
      // ...
  
      return 0;
  
  }
  </code></pre>
  
  <p>Strangely enough, when I run this, the string <code>not special</code> is printed to the console and the rest of the main function carries on with execution.</p>
  
  <p>How can I get the switch statement to function properly here? Thanks!</p>