Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 715 Bytes

compiler-warning-level-1-c4178.md

File metadata and controls

31 lines (27 loc) · 715 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 1) C4178
Compiler Warning (level 1) C4178
11/04/2016
C4178
C4178
2c2c8f97-a5c4-47cd-8dd2-beea172613f3

Compiler Warning (level 1) C4178

case constant 'constant' too big for the type of the switch expression

A case constant in a switch expression does not fit in the type to which it is assigned.

Example

// C4178.cpp
// compile with: /W1
int main()
{
    int i;  // maximum size of unsigned long int is 4294967295
    switch( i )
    {
        case 4294967295:   // OK
            break;
        case 4294967296:   // C4178
            break;
    }
}