misra.py: Fix R12.3 FP on calling functions in function arguments (#2778)
This commit is contained in:
parent
c726c34fdf
commit
4738da3d69
|
@ -1674,6 +1674,9 @@ class MisraChecker:
|
||||||
if token.astParent.str in ('(', '{'):
|
if token.astParent.str in ('(', '{'):
|
||||||
end_token = token.astParent.link
|
end_token = token.astParent.link
|
||||||
if end_token:
|
if end_token:
|
||||||
|
# Don't add function called inside function arguments
|
||||||
|
if token.astParent.previous and token.astParent.previous.isName:
|
||||||
|
continue
|
||||||
end_tokens_map[end_token.linenr].add(end_token.column)
|
end_tokens_map[end_token.linenr].add(end_token.column)
|
||||||
continue
|
continue
|
||||||
elif token.astParent.str == ',':
|
elif token.astParent.str == ',':
|
||||||
|
|
|
@ -459,6 +459,8 @@ void misra_12_3(int a, int b, int c) { // no warning
|
||||||
misra_12_3_fn4(misra_12_3_fn7(&a1, 32), &a1);
|
misra_12_3_fn4(misra_12_3_fn7(&a1, 32), &a1);
|
||||||
misra_12_3_fn6(misra_12_3_fn5(&a1, 32), &a1);
|
misra_12_3_fn6(misra_12_3_fn5(&a1, 32), &a1);
|
||||||
misra_12_3_fn6(misra_12_3_fn7(&a1, 32), &a1);
|
misra_12_3_fn6(misra_12_3_fn7(&a1, 32), &a1);
|
||||||
|
misra_12_3_fn7(maxlen, fn(va, unsigned long), false);
|
||||||
|
misra_12_3_fn8(maxlen, (unsigned long)((uintptr_t)fn(va, void*)), false);
|
||||||
|
|
||||||
const struct fun_t
|
const struct fun_t
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue