>
>
>
V577. Label is present inside switch().…


V577. Label is present inside switch(). Check for typos and consider using the 'default:' operator instead.

The analyzer detected a potential error inside the switch operator. A label is used whose name is similar to 'default'. A misprint is probable.

Consider this sample:

int c = 10;
int r = 0;
switch(c){
case 1:
  r = 3; break;
case 2:
  r = 7; break;
defalt:
  r = 8; break;
}

It seems that after the code's work is done, the value of the 'r' variable will be 8. Actually the 'r' variable will still equal zero. The point is that "defalt" is a label, not the "default" operator. This is the correct code:

int c = 10;
int r = 0;
switch(c){
case 1:
  r = 3; break;
case 2:
  r = 7; break;
default:
  r = 8; break;
}

This diagnostic is classified as: