1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
int foo1(void) { union { char a[sizeof (unsigned)]; unsigned b; } u; u.b = 0x01; return u.a[0]; } int foo2(void) { volatile union { char a[sizeof (unsigned)]; unsigned b; } u; u.b = 0x01; return u.a[0]; } int main(void) { if (foo1() != foo2()) abort (); exit (0); }