Article View: linux.debian.bugs.dist
Article #894Bug#1128548: hexcurse: FTBFS with glibc 2.43 due to ISO C23 const return types
From: Sebastien Bacher
Date: Wed, 14 Oct 2026 21:40
Date: Wed, 14 Oct 2026 21:40
70 lines
4043 bytes
4043 bytes
This is a multi-part MIME message sent by reportbug.
--===============5957314428105898762==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Source: hexcurse
Followup-For: Bug #1128548
X-Debbugs-Cc: seb128@ubuntu.com
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu stonking ubuntu-patch
Control: tags -1 patch ftbfs
Hi,
The attached patch fixes the build. In _getopt_internal() the result of
my_index() (#define'd to strchr) on the const optstring is only ever read,
so the local can simply be declared const char *.
We are carrying it in Ubuntu as hexcurse 1.60.0-2ubuntu1.
Cheers,
Sebastien
-- System Information:
Debian Release: forky/sid
APT prefers resolute-updates
APT policy: (500, 'resolute-updates'), (500, 'resolute-security'), (500, 'resolute'), (100, 'resolute-backports')
Architecture: amd64 (x86_64)
Kernel: Linux 7.0.0-38-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
--===============5957314428105898762==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="glibc-2.43-const.patch"
Description: Fix FTBFS with glibc 2.43 (ISO C23 const-preserving strchr)
With glibc 2.43, strchr() returns a const-qualified pointer when passed a
const-qualified string. optstring is const char *, so assigning the result
to a plain char * triggers -Wdiscarded-qualifiers, fatal with -Werror.
temp is only ever read, so declare it const.
Author: Sebastien Bacher <seb128@ubuntu.com>
Bug-Debian: https://bugs.debian.org/1128548
Forwarded: no
Last-Update: 2026-10-13
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -358,7 +358,7 @@ _getopt_internal (int argc, char *const
{
char c = *nextchar++;
- char *temp = my_index (optstring, c);
+ const char *temp = my_index (optstring, c);
/* Increment `optind' when we start to process its last character. */
if (*nextchar == '\0')
--===============5957314428105898762==--
Technical Details
Message-ID:
<NOeRz-5xho-1@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!bofh.it!news.nic.it!robomodReferences:
<NqxVo-a5AF-39@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!bofh.it!news.nic.it!robomod From: Sebastien Bacher <seb128@ubuntu.com> Newsgroups: linux.debian.bugs.dist Subject: Bug#1128548: hexcurse: FTBFS with glibc 2.43 due to ISO C23 const return types Date: Wed, 14 Oct 2026 23:40:01 +0200 Message-ID: <NOeRz-5xho-1@gated-at.bofh.it> References: <NqxVo-a5AF-39@gated-at.bofh.it> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Wed Oct 14 21:37:08 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.651 Reply-To: Sebastien Bacher <seb128@ubuntu.com>, 1128548@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: seb128@ubuntu.com, team+salvage@tracker.debian.org X-Debian-Pr-Message: followup 1128548 X-Debian-Pr-Package: src:hexcurse X-Debian-Pr-Keywords: ftbfs upstream X-Debian-Pr-Source: hexcurse Content-Type: multipart/mixed; boundary="===============5957314428105898762==" MIME-Version: 1.0 X-Mailer: reportbug 13.2.0+ubuntu1 X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1996843 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 70 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Wed, 14 Oct 2026 23:35:54 +0200 X-Original-Message-ID: <179201375417.497238.11524537714706263985.reportbug@seb128-ThinkPad-T16> X-Original-References: <aZjm9JFT2L1FrSlL@aurel32.net>