mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
CPP: Add a test cases that uses restrict.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
| format.h:16:59:16:61 | str | This argument should be of type 'int' but is of type 'char *' |
|
||||
| format.h:16:64:16:64 | i | This argument should be of type 'double' but is of type 'int' |
|
||||
| format.h:16:67:16:67 | d | This argument should be of type 'char *' but is of type 'double' |
|
||||
| linux_c.c:11:15:11:18 | str3 | This argument should be of type 'char *' but is of type 'short *' |
|
||||
| pri_macros.h:15:35:15:40 | my_u64 | This argument should be of type 'unsigned int' but is of type 'unsigned long long' |
|
||||
| printf1.h:12:27:12:27 | i | This argument should be of type 'double' but is of type 'int' |
|
||||
| printf1.h:18:18:18:18 | i | This argument should be of type 'void *' but is of type 'int' |
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/** standard printf functions */
|
||||
|
||||
int printf(const char *format, ...);
|
||||
|
||||
/** test program */
|
||||
|
||||
void restrict_cases(char * restrict str1, const char * restrict str2, short * restrict str3)
|
||||
{
|
||||
printf("%s", str1); // GOOD
|
||||
printf("%s", str2); // GOOD
|
||||
printf("%s", str3); // BAD
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
semmle-extractor-options: --edg --signed_chars
|
||||
semmle-extractor-options: --clang --edg --signed_chars
|
||||
|
||||
Reference in New Issue
Block a user