[PROPOSED 1/2] Pacify GCC 15.2 -Wzero-as-null-pointer-constant
* localtime.c (time): Use NULL, not 0, for null pointer. --- localtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localtime.c b/localtime.c index 32835d08..0091b81e 100644 --- a/localtime.c +++ b/localtime.c @@ -3135,7 +3135,7 @@ posix2time(time_t t) time_t time(time_t *p) { - time_t r = sys_time(0); + time_t r = sys_time(NULL); if (r != (time_t) -1) { iinntt offset = EPOCH_LOCAL ? timezone : 0; if (offset < IINNTT_MIN + EPOCH_OFFSET -- 2.51.0
* zic.c (doabbr): Declare local var to be char const *, not char *. C23 says strchr is now a qualifier-preserving generic macro, so zic cannot use strchr to silently convert char const * to char *. This pacifies GCC 15.2 -Wdiscarded-qualifiers when compiling with glibc 2.43 (2026-01-24). --- zic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zic.c b/zic.c index 70a2ab09..c10be426 100644 --- a/zic.c +++ b/zic.c @@ -3114,11 +3114,10 @@ doabbr(char *abbr, struct zone const *zp, char const *letters, bool isdst, zic_t save, bool doquotes) { register char * cp; - register char * slashp; ptrdiff_t len; char const *format = zp->z_format; + char const *slashp = strchr(format, '/'); - slashp = strchr(format, '/'); if (slashp == NULL) { char letterbuf[PERCENT_Z_LEN_BOUND + 1]; if (zp->z_format_specifier == 'z') -- 2.51.0
participants (1)
-
Paul Eggert