Modified rule 7.3 (#1232)

This commit is contained in:
Swasti Shrivastava 2018-05-16 15:34:02 +05:30 committed by Daniel Marjamäki
parent e0a6ab1a0f
commit 248e2ef2f8
2 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -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