]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/analyzer/write-to-string-literal-4.c
3d3270ffdbba1f80f9f2ce8b187b9875f578481e
1 typedef __SIZE_TYPE__
size_t;
3 int getrandom (void *__buffer
, size_t __length
,
5 __attribute__ ((access (__write_only__
, 1, 2)));
7 #define GRND_RANDOM 0x02
14 buf
= __builtin_malloc (1024);
16 buf
= (char *)""; /* { dg-message "here" } */
18 if (getrandom(buf
, 16, GRND_RANDOM
)) /* { dg-warning "write to string literal" } */
19 __builtin_printf("%s\n", buf
);