Skip to content

Commit ccc2a39

Browse files
committed
C++: Add wrong format type builtin function test
1 parent ab1b48d commit ccc2a39

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| tests.c:3:74:3:74 | 1 | This format specifier for type 'char *' does not match the argument type 'int'. |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Likely Bugs/Format/WrongTypeFormatArguments.ql
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
void f() {
2+
char buf[35];
3+
__builtin___sprintf_chk(buf, 0, __builtin_object_size(buf, 1), "%s", 1);
4+
__builtin___sprintf_chk(buf, 0, __builtin_object_size(buf, 1), "%d", 1);
5+
}

0 commit comments

Comments
 (0)