mirror of
https://github.com/github/codeql.git
synced 2026-04-25 00:35:20 +02:00
C++: Remove FPs in cpp/wrong-type-format-argument when string type is an error
This commit is contained in:
@@ -171,6 +171,10 @@ where
|
||||
not arg.isAffectedByMacro() and
|
||||
not arg.isFromUninstantiatedTemplate(_) and
|
||||
not actual.getUnspecifiedType() instanceof ErroneousType and
|
||||
not (
|
||||
expected instanceof PointerType and
|
||||
actual.getUnspecifiedType().(PointerType).getBaseType() instanceof ErroneousType
|
||||
) and
|
||||
not arg.(Call).mayBeFromImplicitlyDeclaredFunction()
|
||||
select arg,
|
||||
"This format specifier for type '" + expected.getName() + "' does not match the argument type '" +
|
||||
|
||||
@@ -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:11:18:11:20 | str | This format specifier for type 'char *' does not match the argument type '<error-type> *'. |
|
||||
|
||||
Reference in New Issue
Block a user