PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / c-c++-common / Wcast-align.c
blobfac1795476ca1f4209980b75172c110cdf561a53
1 /* { dg-do compile } */
2 /* { dg-options "-Wcast-align=strict" } */
4 typedef char __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) c;
5 typedef struct __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)))
7 char x;
8 } d;
10 char *x;
11 c *y;
12 d *z;
13 struct s { long long x; } *p;
14 struct t { double x; } *q;
16 void
17 foo (void)
19 y = (c *) x; /* { dg-warning "alignment" } */
20 z = (d *) x; /* { dg-warning "alignment" } */
21 (long long *) p; /* { dg-bogus "alignment" } */
22 (double *) q; /* { dg-bogus "alignment" } */