1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

Silence most -Wzero-as-null-pointer-constant diagnostics

Replace 0 by NULL and {0} by {}.

Omit a few cases that aren't so trivial to fix.

Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059>
Link: <https://software.codidact.com/posts/292718/292759#answer-292759>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-11-16 16:51:31 +01:00
committed by Adhemerval Zanella
parent 83d4b42ded
commit 53fcdf5f74
97 changed files with 263 additions and 262 deletions

View File

@@ -503,7 +503,7 @@ const struct res_sym __p_rcode_syms[] attribute_hidden = {
int
sym_ston(const struct res_sym *syms, const char *name, int *success) {
for ((void)NULL; syms->name != 0; syms++) {
for ((void)NULL; syms->name != NULL; syms++) {
if (strcasecmp (name, syms->name) == 0) {
if (success)
*success = 1;
@@ -519,7 +519,7 @@ const char *
sym_ntos(const struct res_sym *syms, int number, int *success) {
static char unname[20];
for ((void)NULL; syms->name != 0; syms++) {
for ((void)NULL; syms->name != NULL; syms++) {
if (number == syms->number) {
if (success)
*success = 1;
@@ -538,7 +538,7 @@ const char *
sym_ntop(const struct res_sym *syms, int number, int *success) {
static char unname[20];
for ((void)NULL; syms->name != 0; syms++) {
for ((void)NULL; syms->name != NULL; syms++) {
if (number == syms->number) {
if (success)
*success = 1;