[1.3] C99: 9027, 9036 messages are hard to filter out
In the code below, it is very difficult to filter out the messages issued on our boolean type (unsigned8) because the message uses the essential type and we risk filtering out the true unsigned8 variables in this case. We are forced then to dupe PcLint into thinking boolean is actually of type _Bool.
Moreover both messages don't show any symbols for the variables themselves. it would be nice to be able to use esym in such cases for specific enums or booleans, etype would also be great. The more info we have the greater control achieved with egrep too.
Also same as -egrep(9027, "enum .* to ++"), it would be great if we could use -egrep(9027, "boolean .* to !") where boolean is (unsigned8).
It would be also nice to use etype and/or esym for both cases which is not currently possible.
/****************************/
/lint -w3*/
define FALSE (0u)
typedef unsigned char boolean;
typedef unsigned char uint8;
static enum
{
SAFEHWDGSTATE0INIT = 0
, SAFEHWDGSTATE1RUNTIME
, SAFEHWDGSTATEPANIC
} lsSafeHWdgStateen = SAFEHWDGSTATE0INIT;
static boolean IsFailed_bl;
static uint8 x;
void cyclic(void);
void cyclic(void)
{
switch(ls_SafeH_WdgState_en)
{
case SAFEH_WDG_STATE_0_INIT:
IsFailed_bl = FALSE;
x = 0;
ls_SafeH_WdgState_en++;
break;
case SAFEH_WDG_STATE_1_RUNTIME:
if (IsFailed_bl)
{
ls_SafeH_WdgState_en++;
}
break;
case SAFEH_WDG_STATE_PANIC:
ls_SafeH_WdgState_en++;
break;
default:
if ((x == 5u)&&(IsFailed_bl))
{
/* do something */
}
if ((IsFailed_bl)&&(x == 4u))
{
/* do something */
}
break;
}
}
/*****************************/