diff --git a/addons/misra.py b/addons/misra.py index ed504b6df147..84482199dfb0 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -3851,6 +3851,8 @@ def misra_22_10(self, cfg): for token in cfg.tokenlist: if token.str == '(' and not simpleMatch(token.link, ') {'): name, args = cppcheckdata.get_function_call_name_args(token.previous) + if not name: + continue last_function_call = name if token.str == '}': last_function_call = None diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c index ef602a1353f0..2e8360768e85 100644 --- a/addons/test/misra/misra-test.c +++ b/addons/test/misra/misra-test.c @@ -1929,4 +1929,8 @@ static void misra_22_10(void) errno = 0; f = strtod ( "A.12", NULL ); if ( 0 == errno ) {} + + // #10855 + f = strtol(numbuf, 0, (formatHex == 0U) ? 0 : 16); + if (errno != 0) {} }