[PATCH] linux: Enforce zero fill of siginfo_t

Collin Funk collin.funk1@gmail.com
Mon Jan 19 19:03:48 GMT 2026


Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> writes:

>> Ah, and the = { 0 } initializer initializes the array?
>> 
>> Is that standard C?
>
> Afaik it is standard C (sets first member to 0, zeroes the rest).

Not sure about standard C, but POSIX requires it to zero the entire
struct. You can see it used in example for getaddrinfo [1].

I would expect that any compiler is forced to behave that way, since
many programs depend on it.

Collin

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/freeaddrinfo.html


More information about the Libc-alpha mailing list