Fix 10855,11752:False positive: misra-c2012-22.10 (#5557)
This commit is contained in:
parent
f13134a6a4
commit
dde956b085
|
@ -3849,8 +3849,8 @@ class MisraChecker:
|
||||||
def misra_22_10(self, cfg):
|
def misra_22_10(self, cfg):
|
||||||
last_function_call = None
|
last_function_call = None
|
||||||
for token in cfg.tokenlist:
|
for token in cfg.tokenlist:
|
||||||
if token.str == '(' and not simpleMatch(token.link, ') {'):
|
if token.isName and token.next.str == '(' and not simpleMatch(token.next.link, ') {'):
|
||||||
name, args = cppcheckdata.get_function_call_name_args(token.previous)
|
name, args = cppcheckdata.get_function_call_name_args(token)
|
||||||
last_function_call = name
|
last_function_call = name
|
||||||
if token.str == '}':
|
if token.str == '}':
|
||||||
last_function_call = None
|
last_function_call = None
|
||||||
|
|
|
@ -1929,4 +1929,13 @@ static void misra_22_10(void)
|
||||||
errno = 0;
|
errno = 0;
|
||||||
f = strtod ( "A.12", NULL );
|
f = strtod ( "A.12", NULL );
|
||||||
if ( 0 == errno ) {}
|
if ( 0 == errno ) {}
|
||||||
|
|
||||||
|
// #10855
|
||||||
|
f = strtol(numbuf, 0, (formatHex == 0U) ? 0 : 16);
|
||||||
|
if (errno != 0) {}
|
||||||
|
|
||||||
|
// #11752
|
||||||
|
#define NULL_PTR ((void*)0)
|
||||||
|
f = strtod(inStr, NULL_PTR);
|
||||||
|
if(errno != 0) {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue