Примеры ошибок, обнаруженных с помощью диагностики V551
V551. Unreachable code under a 'case' label.
Command & Conquer
V551 The code under this 'case' label is unreachable. The '4109' value of the 'char' type is not in the range [-128; 127]. WINDOWS.CPP 547
#define VK_RETURN 0x0D
typedef enum {
....
WWKEY_VK_BIT = 0x1000,
....
}
enum {
....
KA_RETURN = VK_RETURN | WWKEY_VK_BIT,
....
}
void Window_Print(char const string[], ...)
{
char c; // Current character.
....
switch(c) {
....
case KA_FORMFEED: // <= 12
New_Window();
break;
case KA_RETURN: // <= 4109
Flush_Line();
ScrollCounter++;
WinCx = 0;
WinCy++;
break;
....
}
....
}
Similar errors can be found in some other places:
- V551 The code under this 'case' label is unreachable. The '4105' value of the 'char' type is not in the range [-128; 127]. WINDOWS.CPP 584
- V551 The code under this 'case' label is unreachable. The '4123' value of the 'char' type is not in the range [-128; 127]. WINDOWS.CPP 628