* 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

Reply via email to