//some static const variables are defined
static const uint8_t FirstData = 1;
static const uint8_t SecondData = 2;
//some switch case
switch (Numdata) //Numdata is either FirstData, SecondData
{
case FirstData:
//some code
case SecondData:
//some code
}
// Now PC-lint complaints for this "Note 1960: Violates MISRA C++ 2008 Required Rule 5-0-12, Disallowed use of non-numeric value in a case label"
So the question is why PC-lint does not consider static const members as Numeric value?
Is it a good idea to explicitly type cast case labels (which should resolve this) ?
what type do the case labels need to be type cast to? Will just uint8_t
do?
Some other way to exempt this Lint issue ?