24-10-2019, 06:01 AM
Hello,
Assuming that I have the following structure and enum:
Why does the following code trigger rule 10.3?
Assuming that I have the following structure and enum:
Code:
typedef struct s{
unsigned int a:5;
unsigned int b:1;
unsigned int c:1;
} s;
typedef enum e{
ZERO = 0,
ONE = 1,
TWO = 2,
THREE = 3
} e;
Why does the following code trigger rule 10.3?
Code:
s fcn(void)
{
s test;
test.a = (unsigned int) THREE;
return test;
}
<t></t>