view gcc/testsuite/gcc.dg/pr39464.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* 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-bogus "initialization from incompatible pointer type" } */
  int *b = (T *) p;		/* { dg-bogus "initialization from incompatible pointer type" } */
  U *c = (unsigned int *) p;	/* { dg-bogus "initialization from incompatible pointer type" } */
  unsigned int *d = (U *) p;	/* { dg-bogus "initialization from incompatible pointer type" } */
  (void) a;
  (void) b;
  (void) c;
  (void) d;
}