[PATCH v1] Silence -Wzero-as-null-pointer-constant diagnostics

Florian Weimer fweimer@redhat.com
Fri Nov 15 17:03:49 GMT 2024


* Alejandro Colomar:

> Hi Xi,
>
> On Fri, Nov 15, 2024 at 08:42:47PM GMT, Xi Ruoyao wrote:
>> If you want to mean literally "zero-initializing a struct" you should
>> use {} instead of 0, but doing so is only supported in C23 or as a GNU
>> extension.
>
> Is {} acceptable within glibc's source code?  Or should I take a
> different approach?

It's acceptable outside of installed headers.

Thanks,
Florian



More information about the Libc-alpha mailing list