aboutsummaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-11-16 16:51:31 +0100
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-11-25 16:45:59 -0300
commit53fcdf5f743aa9b02972eec658e66f96d6a63386 (patch)
treee1bd3ed90d89027abe4b8ba6f0dbffd833f08a9b /posix
parent83d4b42ded712bbbc22ceeefe886b8315190da5b (diff)
downloadglibc-53fcdf5f743aa9b02972eec658e66f96d6a63386.tar.xz
glibc-53fcdf5f743aa9b02972eec658e66f96d6a63386.zip
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>
Diffstat (limited to 'posix')
-rw-r--r--posix/getopt.c2
-rw-r--r--posix/regcomp.c2
-rw-r--r--posix/regexec.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/posix/getopt.c b/posix/getopt.c
index e2951f7460..66aaeb3cc4 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -729,7 +729,7 @@ _getopt_internal (int argc, char **argv, const char *optstring,
NAME (int argc, char *const *argv, const char *optstring) \
{ \
return _getopt_internal (argc, (char **)argv, optstring, \
- 0, 0, 0, POSIXLY_CORRECT); \
+ NULL, NULL, 0, POSIXLY_CORRECT); \
}
#ifdef _LIBC
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 5380d3c7b9..1f3c6aec8c 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -674,7 +674,7 @@ re_comp (const char *s)
{
if (!re_comp_buf.buffer)
return gettext ("No previous regular expression");
- return 0;
+ return NULL;
}
if (re_comp_buf.buffer)
diff --git a/posix/regexec.c b/posix/regexec.c
index 180e3bce40..99f49bed62 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -2277,7 +2277,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
mctx->state_log[cur_idx] = next_state;
mctx->state_log_top = cur_idx;
}
- else if (mctx->state_log[cur_idx] == 0)
+ else if (mctx->state_log[cur_idx] == NULL)
{
mctx->state_log[cur_idx] = next_state;
}