mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Remove linker-awareness FPs
This commit is contained in:
@@ -152,6 +152,10 @@ predicate trivialConversion(ExpectedType expected, Type actual) {
|
||||
*/
|
||||
int sizeof_IntType() { exists(IntType it | result = it.getSize()) }
|
||||
|
||||
predicate functionHasUniqueArguments(Function fn) {
|
||||
forall(Parameter p | p = fn.getAParameter() | count(p.getType().getUnspecifiedType()) = 1)
|
||||
}
|
||||
|
||||
from FormattingFunctionCall ffc, int n, Expr arg, Type expected, Type actual
|
||||
where
|
||||
(
|
||||
@@ -171,7 +175,8 @@ where
|
||||
not arg.isAffectedByMacro() and
|
||||
not arg.isFromUninstantiatedTemplate(_) and
|
||||
not actual.stripType() instanceof ErroneousType and
|
||||
not arg.(Call).mayBeFromImplicitlyDeclaredFunction()
|
||||
not arg.(Call).mayBeFromImplicitlyDeclaredFunction() and
|
||||
functionHasUniqueArguments(ffc.getTarget())
|
||||
select arg,
|
||||
"This format specifier for type '" + expected.getName() + "' does not match the argument type '" +
|
||||
actual.getUnspecifiedType().getName() + "'."
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
| tests.c:7:18:7:18 | 1 | This format specifier for type 'char *' does not match the argument type 'int'. |
|
||||
| tests.c:29:27:29:27 | 1 | This format specifier for type 'char *' does not match the argument type 'int'. |
|
||||
|
||||
Reference in New Issue
Block a user