File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed
cpp/ql/src/Likely Bugs/Underspecified Functions Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change 11/**
22 * @name Call to a function with one or more incompatible arguments
3- * @description A call to a function with at least one argument whose type does
4- * not match the type of the corresponding function parameter. This may indicate
5- * that the author is not familiar with the function being called. Passing mistyped
6- * arguments on a stack may lead to unpredictable function behavior.
3+ * @description When the type of a function argument is not compatible
4+ * with the type of the corresponding parameter, it may lead to
5+ * unpredictable behavior.
76 * @kind problem
87 * @problem.severity warning
98 * @precision medium
Original file line number Diff line number Diff line change @@ -31,24 +31,13 @@ predicate isCompiledAsC(Function f) {
3131 )
3232}
3333
34- predicate isWhitelisted ( Function f ) {
35- f instanceof BuiltInFunction
36- or
37- // The following list can be expanded as the need arises
38- exists ( string name | name = f .getName ( ) |
39- name = "static_assert" or
40- name = "_Static_assert" or
41- name = "strptime"
42- )
43- }
44-
4534from FunctionCall fc , Function f
4635where
4736 f = fc .getTarget ( ) and
4837 not f .isVarargs ( ) and
4938 hasZeroParamDecl ( f ) and
5039 isCompiledAsC ( f ) and
51- not isWhitelisted ( f ) and
40+ exists ( f . getBlock ( ) ) and
5241 // There must not exist a declaration with the number of parameters
5342 // at least as large as the number of call arguments
5443 not exists ( FunctionDeclarationEntry fde | fde = f .getADeclarationEntry ( ) |
You can’t perform that action at this time.
0 commit comments