mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C++: Expose a type resolution issue.
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
| include_twice.h:8:19:8:19 | s | This format specifier for type 'size_t' does not match the argument type '..(*)(..)'. |
|
||||
| include_twice.h:9:19:9:19 | s | This format specifier for type 'size_t' does not match the argument type '..(*)(..)'. |
|
||||
| include_twice.h:10:18:10:18 | s | This format specifier for type 'int' does not match the argument type '..(*)(..)'. |
|
||||
| include_twice.h:10:18:10:18 | s | This format specifier for type 'int' does not match the argument type 'unsigned long'. |
|
||||
| include_twice.h:11:19:11:19 | s | This format specifier for type 'long' does not match the argument type '..(*)(..)'. |
|
||||
| include_twice.h:12:20:12:20 | s | This format specifier for type 'long long' does not match the argument type '..(*)(..)'. |
|
||||
| include_twice.h:13:18:13:18 | s | This format specifier for type 'unsigned int' does not match the argument type '..(*)(..)'. |
|
||||
| include_twice.h:13:18:13:18 | s | This format specifier for type 'unsigned int' does not match the argument type 'unsigned long'. |
|
||||
| include_twice.h:21:18:21:39 | ... - ... | This format specifier for type 'int' does not match the argument type 'long'. |
|
||||
| include_twice.h:21:18:21:39 | ... - ... | This format specifier for type 'int' does not match the argument type 'long'. |
|
||||
|
||||
@@ -5,11 +5,11 @@ void test_size_t() {
|
||||
|
||||
printf("%zd", s); // GOOD
|
||||
printf("%zi", s); // GOOD
|
||||
printf("%zu", s); // GOOD
|
||||
printf("%zx", s); // GOOD
|
||||
printf("%zu", s); // GOOD [FALSE POSITIVE]
|
||||
printf("%zx", s); // GOOD [FALSE POSITIVE]
|
||||
printf("%d", s); // BAD
|
||||
printf("%ld", s); // BAD [NOT DETECTED]
|
||||
printf("%lld", s); // BAD [NOT DETECTED]
|
||||
printf("%ld", s); // BAD
|
||||
printf("%lld", s); // BAD
|
||||
printf("%u", s); // BAD
|
||||
|
||||
char buffer[1024];
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
int printf(const char * format, ...);
|
||||
|
||||
// defines type `myFunctionPointerType`
|
||||
typedef int (*myFunctionPointerType) ();
|
||||
// defines type `myFunctionPointerType`, referencing `size_t`
|
||||
typedef size_t (*myFunctionPointerType) ();
|
||||
|
||||
#include "include_twice.h"
|
||||
|
||||
Reference in New Issue
Block a user