diff --git a/addons/misra.py b/addons/misra.py index 48dcf2d13..25041d772 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -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): diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c index 1b6389ecd..217417742 100644 --- a/addons/test/misra/misra-test.c +++ b/addons/test/misra/misra-test.c @@ -45,7 +45,7 @@ typedef struct { union { // 19.2 struct { - unsigned a : 2; // 8.1 + unsigned a : 2; unsigned : 14; }; uint16_t value;