File tree Expand file tree Collapse file tree
cpp/ql/src/Likely Bugs/Underspecified Functions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,13 +27,24 @@ predicate isCompiledAsC(Function f) {
2727 )
2828}
2929
30+ predicate isWhitelisted ( Function f ) {
31+ f instanceof BuiltInFunction
32+ or
33+ // The following list can be expanded as the need arises
34+ exists ( string name | name = f .getName ( ) |
35+ name = "static_assert" or
36+ name = "_Static_assert" or
37+ name = "strptime"
38+ )
39+ }
40+
3041from FunctionCall fc , Function f
3142where
3243 f = fc .getTarget ( ) and
3344 not f .isVarargs ( ) and
34- not f instanceof BuiltInFunction and
3545 hasZeroParamDecl ( f ) and
3646 isCompiledAsC ( f ) and
47+ not isWhitelisted ( f ) and
3748 // There must not exist a declaration with the number of parameters
3849 // at least as large as the number of call arguments
3950 not exists ( FunctionDeclarationEntry fde | fde = f .getADeclarationEntry ( ) |
You can’t perform that action at this time.
0 commit comments