[Bug middle-end/87363] Duplicate and bogus -Wstringop-overflow warning

2018-09-19 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87363 --- Comment #5 from Bernd Edlinger --- Using named struct members does not make a difference. Of course it is possible that converting address of u.b.z to const char *, makes the example undefined, as strlen is not really accessing the bytes thru

[Bug middle-end/87363] Duplicate and bogus -Wstringop-overflow warning

2018-09-19 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87363 --- Comment #4 from joseph at codesourcery dot com --- I think the *member* of the union here (the one that is active after the initialization) is the anonymous struct containing x and y. That would surely be the case if you named the two stru

[Bug middle-end/87363] Duplicate and bogus -Wstringop-overflow warning

2018-09-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87363 --- Comment #3 from Martin Sebor --- If u's initialization is viewed as a single assignment then you're right. If the initialization of u is viewed as two separate assignments: u.x = "1234"; u.y = "567"; then strictly speaking, after the s

[Bug middle-end/87363] Duplicate and bogus -Wstringop-overflow warning

2018-09-19 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87363 --- Comment #2 from joseph at codesourcery dot com --- On Wed, 19 Sep 2018, msebor at gcc dot gnu.org wrote: > Other than that, since > > When a value is stored in a member of an object of union type, the bytes of > the object representation

[Bug middle-end/87363] Duplicate and bogus -Wstringop-overflow warning

2018-09-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87363 Martin Sebor changed: What|Removed |Added Keywords||diagnostic Status|UNCONFIRMED