https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90167
--- Comment #4 from Laszlo Ersek (RH) ---
So one way to define the behavior for the original example (from the gcc docs)
would be:
int f(void) {
double d = 3.0;
union a_union u = *(union a_union *)&d;
return u.i;
}
Thanks.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90167
--- Comment #2 from Laszlo Ersek (RH) ---
(In reply to Segher Boessenkool from comment #1)
> The code accesses d, of type double, as an int. That is not a
> compatible type.
Agreed; I didn't claim it was.
> It does not matter how it got there,
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: lersek at redhat dot com
Target Milestone: ---
The gcc manual says the following under "-fstrict-aliasing"
<https://gcc.gnu.org/onlinedocs/