PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-8.c
blob85839f3f07eea164daae0ddbb7ab596343493fe4
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -Wall" } */
3 /* based on PR 43833 */
5 extern unsigned char data[5];
7 unsigned char
8 foo (char *str)
10 int i, j;
11 unsigned char c = 0;
13 for (i = 0; i < 8; i++)
15 j = i * 5;
16 if ((j % 8) > 3)
17 c |= data[(j / 8) + 1];
19 return c;