misra: fix false positive in 11.7 (#2233)

This commit is contained in:
Conrado Gouvea 2019-10-03 05:15:50 -03:00 committed by Daniel Marjamäki
parent 997803869d
commit 67971db58f
2 changed files with 6 additions and 1 deletions

View File

@ -1209,7 +1209,7 @@ class MisraChecker:
continue
if (vt2.pointer > 0 and vt1.pointer == 0 and
not vt1.isIntegral() and not vt1.isEnum() and
vt2.type != 'void'):
vt1.type != 'void'):
self.reportError(token, 11, 7)
elif (vt1.pointer > 0 and vt2.pointer == 0 and
not vt2.isIntegral() and not vt2.isEnum() and

View File

@ -258,6 +258,11 @@ void misra_11_7(int *p, float f) {
y = ( int * ) f; //11.7
}
void misra_11_7_extra(int *p, float f, bool b) {
(void) p; // no-warning
(void) f; // no-warning
}
char * misra_11_8_const(const char *str) { }
char * misra_11_8(const char *str) {
(void)misra_11_8_const(str); // no-warning