https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116082

--- Comment #5 from Steffen Nurpmeso <steffen at sdaoden dot eu> ---
different to some other comments i think this is plain a bug in gcc.
C99, 6.7.8 p21, and C23 is not different (here 6.7.10 p22; disclaimer: i have
not truly read any standard beyond C99, though!!) want
```
If there are fewer initializers in a brace-enclosed list than there are
elements or members of an aggregate, or fewer characters in a string literal
used to initialize an array of known size than there are elements in the array,
the remainder of the aggregate shall be initialized implicitly the same as
objects that have static storage duration.
```
so with char we get NUL aka "null character" padding.

However, if the initializer already has a null character terminator, then why
should gcc enforce yet another NUL, it should simply not apply padding if there
is no room.

Now, since this bug is ten months old, can it be implied that on the code
production level nothing bad happens?

Reply via email to