File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1693,7 +1693,7 @@ def misra_6_1(self, data):
16931693 continue
16941694
16951695 if data .standards .c == 'c89' :
1696- if token .valueType .type != 'int' :
1696+ if token .valueType .type != 'int' and not isUnsignedType ( token . variable . typeStartToken . str ) :
16971697 self .reportError (token , 6 , 1 )
16981698 elif data .standards .c == 'c99' :
16991699 if token .valueType .type == 'bool' :
@@ -1702,7 +1702,7 @@ def misra_6_1(self, data):
17021702 isExplicitlySignedOrUnsigned = False
17031703 typeToken = token .variable .typeStartToken
17041704 while typeToken :
1705- if typeToken .isUnsigned or typeToken .isSigned :
1705+ if typeToken .isUnsigned or typeToken .isSigned or isUnsignedType ( typeToken . str ) :
17061706 isExplicitlySignedOrUnsigned = True
17071707 break
17081708
Original file line number Diff line number Diff line change @@ -252,6 +252,7 @@ struct struct_with_bitfields
252252 signed long f :2 ; // 6.1 - signed long not compliant
253253 unsigned int g :1 ; // Compliant
254254 signed int h :1 ; // 6.2 - signed int with size 1 is not compliant
255+ uint16_t i :1 ; // Compliant
255256};
256257
257258static void misra6_1_fn (void ) {
You can’t perform that action at this time.
0 commit comments