[Bug c/84046] [6/7/8 Regression] global zero-sized objects may have same address

2018-01-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84046 --- Comment #6 from Jakub Jelinek --- Zero sized object occupies zero bytes, if you have an array of them, necessarily all the elements of the array need to have the same address. While individual variables could be in theory padded, it would

[Bug c/84046] [6/7/8 Regression] global zero-sized objects may have same address

2018-01-27 Thread uecker at eecs dot berkeley.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84046 --- Comment #5 from Martin Uecker --- (In reply to Jakub Jelinek from comment #4) > If you want aggregate with size 1 and isn't used to store information, use > typedef struct { char : 1; } zero; > instead. Yes, thank you. But for my

[Bug c/84046] [6/7/8 Regression] global zero-sized objects may have same address

2018-01-26 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84046 --- Comment #4 from Jakub Jelinek --- If you want aggregate with size 1 and isn't used to store information, use typedef struct { char : 1; } zero; instead.

[Bug c/84046] [6/7/8 Regression] global zero-sized objects may have same address

2018-01-26 Thread uecker at eecs dot berkeley.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84046 --- Comment #3 from Martin Uecker --- (In reply to Richard Biener from comment #1) > Confirmed. I think the C language doesn't specify this since zero-sized > arrays are a GNU extension and thus in C no zero-sized types/decls exist? > > So

[Bug c/84046] [6/7/8 Regression] global zero-sized objects may have same address

2018-01-26 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84046 Jakub Jelinek changed: What|Removed |Added Status|WAITING |RESOLVED CC|

[Bug c/84046] [6/7/8 Regression] global zero-sized objects may have same address

2018-01-26 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84046 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |WAITING Known to work|