Skip to content

Commit 5e32890

Browse files
committed
CPP: Modify violation message of NonPortablePrintf.ql for consistency with WrongTypeFormatArguments.ql.
1 parent 5cef0e2 commit 5e32890

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cpp/ql/src/Likely Bugs/Memory Management/Padding/NonPortablePrintf.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ where (
8484
and not arg.isAffectedByMacro()
8585
and size32 = ilp32.paddedSize(actual) and size64 = lp64.paddedSize(actual)
8686
and size64 != size32
87-
select arg, "This argument should be of type "+expected.getName()+" but is of type "+actual.getName() +
88-
" (which changes size from " + size32 + " to " + size64 + " on 64-bit systems)."
87+
select arg, "This argument should be of type '" + expected.getName() + "' but is of type '" + actual.getName() +
88+
"' (which changes size from " + size32 + " to " + size64 + " on 64-bit systems)."
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| test.cpp:10:17:10:17 | l | This argument should be of type int but is of type long (which changes size from 32 to 64 on 64-bit systems). |
2-
| test.cpp:13:17:13:19 | ptr | This argument should be of type int but is of type void * (which changes size from 32 to 64 on 64-bit systems). |
3-
| test.cpp:14:17:14:19 | ptr | This argument should be of type unsigned int but is of type void * (which changes size from 32 to 64 on 64-bit systems). |
4-
| test.cpp:15:17:15:19 | ptr | This argument should be of type unsigned int but is of type void * (which changes size from 32 to 64 on 64-bit systems). |
1+
| test.cpp:10:17:10:17 | l | This argument should be of type 'int' but is of type 'long' (which changes size from 32 to 64 on 64-bit systems). |
2+
| test.cpp:13:17:13:19 | ptr | This argument should be of type 'int' but is of type 'void *' (which changes size from 32 to 64 on 64-bit systems). |
3+
| test.cpp:14:17:14:19 | ptr | This argument should be of type 'unsigned int' but is of type 'void *' (which changes size from 32 to 64 on 64-bit systems). |
4+
| test.cpp:15:17:15:19 | ptr | This argument should be of type 'unsigned int' but is of type 'void *' (which changes size from 32 to 64 on 64-bit systems). |

0 commit comments

Comments
 (0)