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