mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
C++: Add a test of unknown format specifiers (with specsAreKnown check disabled).
This commit is contained in:
@@ -12,3 +12,6 @@
|
||||
| test.c:39:3:39:8 | call to printf | Format expects 2 arguments but given 5 |
|
||||
| test.c:40:3:40:8 | call to printf | Format expects 2 arguments but given 4 |
|
||||
| test.c:41:3:41:8 | call to printf | Format expects 2 arguments but given 3 |
|
||||
| test.c:46:2:46:7 | call to printf | Format expects 1 arguments but given 2 |
|
||||
| test.c:47:2:47:7 | call to printf | Format expects 1 arguments but given 2 |
|
||||
| test.c:48:2:48:7 | call to printf | Format expects 1 arguments but given 2 |
|
||||
|
||||
@@ -42,4 +42,8 @@ void test(int i, const char *str)
|
||||
}
|
||||
|
||||
printf("%@ %i %i", 1, 2); // GOOD
|
||||
|
||||
printf("%Y", 1, 2); // GOOD (unknown format character, this might be correct) [FALSE POSITIVE]
|
||||
printf("%1.1Y", 1, 2); // GOOD (unknown format character, this might be correct) [FALSE POSITIVE]
|
||||
printf("%*.*Y", 1, 2); // GOOD (unknown format character, this might be correct) [FALSE POSITIVE]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user