aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr39464.c
blob: cd745406da8b32994b271b206b2fac576b6c9c42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* PR c/39464 */
/* { dg-do compile } */
/* { dg-options "-Wall" } */

typedef int T __attribute__((may_alias));
typedef unsigned int U __attribute__((may_alias));

void
foo (void *p)
{
  T *a = (int *) p;		/* { dg-warning "initialization from incompatible pointer type" } */
  int *b = (T *) p;		/* { dg-warning "initialization from incompatible pointer type" } */
  U *c = (unsigned int *) p;	/* { dg-warning "initialization from incompatible pointer type" } */
  unsigned int *d = (U *) p;	/* { dg-warning "initialization from incompatible pointer type" } */
  (void) a;
  (void) b;
  (void) c;
  (void) d;
}