GNU bug report logs - #77835
[PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings

Previous Next

Package: emacs;

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


Message #13 received at 77835-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Collin Funk <collin.funk1 <at> gmail.com>
Cc: 77835-done <at> debbugs.gnu.org
Subject: Re: bug#77835: [PATCH] Pacify GCC 15
 -Wunterminated-string-initialization warnings
Date: Sat, 19 Apr 2025 22:41:33 -0700
[Message part 1 (text/plain, inline)]
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. 
Thanks.

Closing the bug report as the bug is fixed now, one way or another.
[0001-Pacify-GCC-15-Wunterminated-string-initialization.patch (text/x-patch, attachment)]

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.