PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-object-size-11.c
blob7c4a921cbb76046487ec4fed5e30f1bbde0fe133
1 /* PR48985 */
2 /* { dg-do run } */
3 /* { dg-options "-std=gnu89" } */
4 /* { dg-skip-if "packed attribute missing for struct s" { "epiphany-*-*" } } */
6 extern void abort (void);
8 struct s {
9 int i;
10 char c[];
11 } s = { 1, "01234" };
13 __SIZE_TYPE__ f (void) { return __builtin_object_size (&s.c, 0); }
15 int
16 main()
18 if (f() != sizeof ("01234"))
19 abort ();
21 return 0;