MISRA Rule 11.6 will no longer report violation on '(void)p;' (#1272)
This commit is contained in:
parent
cc77a6aa62
commit
e1014253ef
|
@ -901,7 +901,7 @@ def misra_11_6(data):
|
|||
continue
|
||||
if vt1.pointer == 1 and vt1.type == 'void' and vt2.pointer == 0 and token.astOperand1.str != "0":
|
||||
reportError(token, 11, 6)
|
||||
elif vt1.pointer == 0 and vt2.pointer == 1 and vt2.type == 'void':
|
||||
elif vt1.pointer == 0 and vt1.type != 'void' and vt2.pointer == 1 and vt2.type == 'void':
|
||||
reportError(token, 11, 6)
|
||||
|
||||
|
||||
|
|
|
@ -196,9 +196,10 @@ void misra_11_5(void *p) {
|
|||
|
||||
void misra_11_6() {
|
||||
void *p;
|
||||
p = (void*)123; // 11.6
|
||||
x = (u64)p; // 11.6
|
||||
p = ( void * )0 // no-warning
|
||||
p = (void*)123; // 11.6
|
||||
x = (u64)p; // 11.6
|
||||
p = ( void * )0; // no-warning
|
||||
(void)p; // no-warning
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue