다음을 통해 공유


Compiler Warning (level 4) C4061

 

The latest version of this topic can be found at Compiler Warning (level 4) C4061.

enumerator 'identifier' in switch of enum 'enumeration' is not explicitly handled by a case label

The enumerate has no associated handler in a switch statement.

This warning is off by default. See Compiler Warnings That Are Off by Default for more information.

The following sample generates C4061:

// C4061.cpp  
// compile with: /W4  
#pragma warning(default : 4061)  
  
enum E { a, b, c };  
void func ( E e )  
{  
   switch(e)  
   {  
      case a:  
      case b:  
      default:  
         break;  
   }   // C4061 c' not handled  
}  
  
int main()  
{  
}