GNU bug report logs -
#77835
[PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings
Previous Next
Reported by: Collin Funk <collin.funk1 <at> gmail.com>
Date: Wed, 16 Apr 2025 05:25:02 UTC
Severity: normal
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Sat, 19 Apr 2025 22:41:33 -0700
> Cc: 77835-done <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
>
> On 2025-04-16 02:40, Eli Zaretskii wrote:
> > - static char const hexdigit[16] = "0123456789abcdef";
> > + static char const hexdigit[17] = "0123456789abcdef";
>
> Although that would pacify GCC, it would make the code more confusing
> because it doesn't clearly indicate to the human reader that hexdigit is
> unusual because it is used only as a 16-element array, not as a
> null-terminated string.
>
> I ran into this problem independently and installed the obvious patch
> (attached). I didn't recall your email suggesting this other solution
> until just now. If you prefer the more-confusing solution please feel to
> install it, but at least please add comments explaining what's going on.
How portable is the attribute you used to fix this? AFAICT, it is
supported since GCC 4.8, but our INSTALL indicates that we support
older versions of GCC. Or does Gnulib solve this?
This bug report was last modified 32 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.