From 13c80d6cce95b8d4b1a9f3fcc405a280c2caea9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 28 Jul 2022 20:34:56 +0200 Subject: [PATCH] Fixed #11180 (False positive: misra-c2012-8.1 for code 'unsigned x;') --- addons/misra.py | 2 +- addons/test/misra/misra-test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;