title: generating enum compilation errors in C
body: <p>I'm trying to generate an enum compilation error by runing the following code in VS2010:</p>
  
  <pre><code>typedef enum {F,E,D,C,B,A} grade_t;
  main(){
      grade_t james=E+A;
      printf("%d",james);
  }
  </code></pre>
  
  <p>however it still runs and prints 6 to the screen.
  As far as I know james should be assigned only the enum defined consts. I also get the expected compilation error while writing the above assignment: </p>
  
  <pre><code>IntelliSense: a value of type "int" cannot be used to initialize an entity of type "grade_t"    
  </code></pre>
  
  <p>1) Why does it run even though it is out of range?<br>
  2) Does it mean that some compilation errors might be considered as logic errors?</p>