From 248e2ef2f8d65a1d7b68414c271a30fd4ffca226 Mon Sep 17 00:00:00 2001 From: Swasti Shrivastava <37058682+swasti16@users.noreply.github.com> Date: Wed, 16 May 2018 15:34:02 +0530 Subject: [PATCH] Modified rule 7.3 (#1232) --- addons/misra.py | 2 +- addons/test/misra-test.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/misra.py b/addons/misra.py index e2b9a4e98..17e294175 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -599,7 +599,7 @@ def misra_7_1(rawTokens): def misra_7_3(rawTokens): - compiled = re.compile(r'^[0-9]+l') + compiled = re.compile(r'^[0-9.uU]+l') for tok in rawTokens: if compiled.match(tok.str): reportError(tok, 7, 3) diff --git a/addons/test/misra-test.c b/addons/test/misra-test.c index b5952ab6e..d58aec43e 100644 --- a/addons/test/misra-test.c +++ b/addons/test/misra-test.c @@ -122,9 +122,13 @@ void misra_7_1() { } void misra_7_3() { - int x = 12l; // 7.3 - int x = 12lu; // 7.3 5.2 -} + long misra_7_3_a = 0l; //7.3 + long misra_7_3_b = 0lU; //7.3 + long long misra_7_3_c = 0Ull; //7.3 + long long misra_7_3_d = 0ll; //7.3 + long double misra_7_3_e = 7.3l; //7.3 + } + extern int a811[]; // 8.11