☰
Debian Codegraph
@
15:15.3.rel1-2
15:15.3.rel1-1
/
/
gcc
/
testsuite
/
gcc.dg
/
Wstrict-aliasing-struct-with-char-member.c
☽
☼
gcc/testsuite/gcc.dg/Wstrict-aliasing-struct-with-char-member.c
code
plain
raw
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
}