Fixed #11180 (False positive: misra-c2012-8.1 for code 'unsigned x;')

This commit is contained in:
Daniel Marjamäki 2022-07-28 20:34:56 +02:00
parent 5d5b6bda3a
commit 13c80d6cce
2 changed files with 2 additions and 2 deletions

View File

@ -1842,7 +1842,7 @@ class MisraChecker:
def misra_8_1(self, cfg):
for token in cfg.tokenlist:
if token.isImplicitInt:
if token.isImplicitInt and not token.isUnsigned and not token.isSigned:
self.reportError(token, 8, 1)
def misra_8_2(self, data, rawTokens):

View File

@ -45,7 +45,7 @@
typedef struct {
union { // 19.2
struct {
unsigned a : 2; // 8.1
unsigned a : 2;
unsigned : 14;
};
uint16_t value;