[Bug c/90167] invalid example in GCC documentation wrt. effective type rules

2019-04-24 Thread lersek at redhat dot com
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.

[Bug c/90167] invalid example in GCC documentation wrt. effective type rules

2019-04-23 Thread lersek at redhat dot com
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,

[Bug c/90167] New: invalid example in GCC documentation wrt. effective type rules

2019-04-18 Thread lersek at redhat dot com
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/