[Bug c/109956] GCC reserves 9 bytes for struct s { int a; char b; char t[]; } x = {1, 2, 3};
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Wed May 24 21:50:47 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109956
--- Comment #6 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
For the standard, dynamically allocated case, you should only need to
allocate enough memory to contain the initial part of the struct and the
array members being accessed - not any padding after that array. (There
were wording problems before C99 TC2; see DR#282.)
More information about the Gcc-bugs
mailing list