I am running PC-Lint 8.00x on code similar to the following:
typedef union
{
struct
{
unsigned int blue : 5;
unsigned int green : 6;
unsigned int red : 5;
};
unsigned short color_value;
} Color_Type;
Color_Type my_color;
unsigned char blue;
blue = (unsigned char)my_color.blue; /* Lint messages occur here */
PC-Lint returns the following error messages:
Error 40: Undeclared identifier 'blue'
Error 63: Expected an lvalue
The code compiles and runs as expected. I am assuming this is because of the anonymous struct, is that assumption correct? If so, how can I suppress these messages for this particular circumstance? I currently suppress messages in the "options.lnt" file as our local coding practice prohibits putting comments directly in the code to suppress Lint messages.