aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/alias-8.c
blob: 690f1b62da94bd8045ab83bed16052de232dafeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// { dg-do compile }
// { dg-options "-Wstrict-aliasing=2 -fstrict-aliasing" }

struct s {
  char    *p;
};

void
func(struct s *ptr)
{
  *(void **)&ptr->p = 0; /* { dg-warning "type-punned pointer" } */
}