CPP: Add a test of ODASA-3654.

This commit is contained in:
Geoffrey White
2019-03-26 12:37:32 +00:00
parent 4075f570e2
commit bd138238b0
2 changed files with 3 additions and 0 deletions

View File

@@ -6,3 +6,4 @@
| test.c:15:2:15:7 | call to printf | Format expects 3 arguments but given 2 |
| test.c:19:2:19:7 | call to printf | Format expects 2 arguments but given 1 |
| test.c:29:3:29:8 | call to printf | Format expects 2 arguments but given 1 |
| test.c:44:2:44:7 | call to printf | Format expects 3 arguments but given 2 |

View File

@@ -40,4 +40,6 @@ void test(int i, const char *str)
printf("%2$.*4$f", 0, num, 0, precision); // GOOD [FALSE POSITIVE]
printf("%2$.*4$f", num, 0, precision); // BAD (too few format arguments) [INCORRECT MESSAGE]
}
printf("%@ %i %i", 1, 2); // GOOD [FALSE POSITIVE]
}