Debian Codegraph @

gcc/testsuite/gcc.dg/analyzer/write-to-function-1.c

raw
1 /* { C only: C++ does not allow for conversion from function pointer to 'void *' */
2
3 typedef __SIZE_TYPE__ size_t;
4
5 int getrandom (void *__buffer, size_t __length, /* { dg-message "parameter 1 of 'getrandom' marked with attribute 'access \\(write_only, 1, 2\\)'" } */
6 unsigned int __flags)
7 __attribute__ ((access (__write_only__, 1, 2)));
8
9 #define GRND_RANDOM 0x02
10
11 void test (void)
12 {
13 char buf[16];
14
15 if (getrandom(test, 16, GRND_RANDOM)) /* { dg-warning "write to function 'test'" } */
16 __builtin_printf("%s\n", buf);
17 }