title: Clang with C code: enumeration values not explicitly handled in switch
body: <p>I'm trying to compile this code with clang 3.1 and the option <code>-Weverything</code>:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;SDL/SDL.h&gt;
  
  SDL_Surface* init(SDL_Surface* screen);
  
  
  int main() {
      SDL_Event event;
      SDL_Surface* screen = NULL;
      int quit = 0;
  
      screen = init(screen);
      if (screen == NULL) {
          return EXIT_FAILURE;
      }
      while(quit == 0) {
          while(SDL_PollEvent(&amp;event)) {
              if( event.type == SDL_QUIT ) {
                  quit = 1;
              } else if( event.type == SDL_KEYDOWN ) {
                  switch( event.key.keysym.sym ) {
                      case SDLK_UP: printf("up\n"); break;
                      case SDLK_DOWN: printf("down\n"); break;
                      case SDLK_LEFT: printf("left\n"); break;
                      case SDLK_RIGHT: printf("right\n"); break;
                      default: break;
                  }
              }
          }
      }
      SDL_FreeSurface(screen);
      SDL_Quit();
      return 0;
  }
  
  SDL_Surface* init(SDL_Surface* screen) {
      if( SDL_Init(SDL_INIT_EVERYTHING) == -1) {
          return NULL;
      }
      screen=SDL_SetVideoMode(100,100,32,SDL_SWSURFACE);
      return screen;
  }
  </code></pre>
  
  <p>The compiler then returns me the following warning</p>
  
  <pre><code>main.c:22:25: warning: 229 enumeration values not explicitly handled in switch: 'SDLK_UNKNOWN', 'SDLK_BACKSPACE',
        'SDLK_TAB'... [-Wswitch-enum]
                  switch( event.key.keysym.sym ) {
                          ^
  </code></pre>
  
  <p>Elsewhere I've read similar error messages and people solved it by adding the <code>default</code> case, but here as you can see it's already there. I would really like to compile my code without a single warning, and of course here without needing to put the 229 possible cases. </p>