Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Warning (level 1) C4178
Collapse the table of content
Expand the table of content

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.

// 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;
    }
 }

Community Additions

ADD
Show:
© 2015 Microsoft