https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118997
--- Comment #8 from Jakub Jelinek ---
The documentation is fairly clear that it affects that:
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Although the size of a zero-length array is zero, an array member of this kind
may increase the siz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118997
--- Comment #7 from Vincenzo Romano ---
Quoting from "6.18 Arrays of Length Zero"
> Declaring zero-length arrays is allowed in GNU C as an extension.
I would say that under GNU C it is an extension.
Or that the documentation needs some review
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118997
--- Comment #6 from Jonathan Wakely ---
You don't even need the 'two' member to get the same effect:
typedef struct _test {
_Alignas(long double) void* one;
} _test;
If the structure has to be aligned, then you will get padding after the 'on
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118997
Xi Ruoyao changed:
What|Removed |Added
CC||xry111 at gcc dot gnu.org
--- Comment #5 fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118997
--- Comment #4 from Vincenzo Romano ---
I think that an explicit statement in the documentation should be added, then.
After all the zero-sized array field is both an extension (thus not in the
standard manual) and a special case within the exte
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118997
--- Comment #3 from Richard Biener ---
(In reply to Jakub Jelinek from comment #2)
> Your expectations are wrong.
> If sizeof(void*) == 8 and alignof(long double) == 16, then padding needs to
> be inserted
> before the two member such that it is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118997
Jakub Jelinek changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118997
--- Comment #1 from Vincenzo Romano ---
As a third option, you could add to the documentation a "caveat" statement when
the developer IS NOT using char as the base type for the trailing zero-sized
array field.