C99 struct initialization
Error is generated with the foolowing code, which is valide C99:
typedef union
{
struct
{
unsigned int a : 4;
unsigned int b : 4;
unsigned int c : 4;
unsigned int d : 4;
} bits;
unsigned short value;
} My_Value;
int main(void)
{
My_Value test[] =
{
{
.bits.a = 2,
.bits.b = 3,
.bits.c = 2,
.bits.d = 3,
},
{
.bits.a = 1,
.bits.b = 1,
.bits.c = 1,
.bits.d = 0,
},
};
return 0;
}
This issue is corrected in the upcoming PC-lint Plus. If you are encountering an issue with C99 struct initialization in PC-lint or FlexeLint, please contact support for assistance.
-
Anonymous commented
This is a very common pattern used in processor header files, which makes linting on embedded systems complicated.