CPP: Modify violation message of NonPortablePrintf.ql for consistency with WrongTypeFormatArguments.ql.

This commit is contained in:
Geoffrey White
2019-06-27 16:38:03 +01:00
parent 5cef0e21c6
commit 5e328908a0
2 changed files with 6 additions and 6 deletions

View File

@@ -84,5 +84,5 @@ where (
and not arg.isAffectedByMacro()
and size32 = ilp32.paddedSize(actual) and size64 = lp64.paddedSize(actual)
and size64 != size32
select arg, "This argument should be of type "+expected.getName()+" but is of type "+actual.getName() +
" (which changes size from " + size32 + " to " + size64 + " on 64-bit systems)."
select arg, "This argument should be of type '" + expected.getName() + "' but is of type '" + actual.getName() +
"' (which changes size from " + size32 + " to " + size64 + " on 64-bit systems)."

View File

@@ -1,4 +1,4 @@
| 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). |
| 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). |
| 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). |
| 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). |
| 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). |
| 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). |
| 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). |
| 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). |