(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
Wstrict-aliasing-struct-with-char-member.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -Wall" } */
       3  
       4  struct a {
       5      int i;
       6      char c;
       7  };
       8  struct b {
       9      float f;
      10      float g;
      11  };
      12  int main(void)
      13  {
      14    static struct b b;
      15    return ((struct a *)&b)->i; /* { dg-warning "will break strict-aliasing" } */
      16  }