Article View: linux.debian.bugs.dist
Article #822Bug#1128549: ifhp: FTBFS with glibc 2.43 due to ISO C23 const return types
From: Sebastien Bacher
Date: Wed, 14 Oct 2026 08:30
Date: Wed, 14 Oct 2026 08:30
101 lines
5195 bytes
5195 bytes
This is a multi-part MIME message sent by reportbug.
--===============5408498560198090974==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Source: ifhp
Followup-For: Bug #1128549
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 with glibc 2.43: strchr, strrchr,
strpbrk and strstr now return const char * when passed a const char *,
so src/safestrutil.c needs explicit casts in the wrappers declared to
return char *. It keeps the existing API.
Tested in Ubuntu with glibc 2.44 (amd64), where the package builds
again with it. Ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/ifhp/+bug/2170781
Thanks,
Sebastien Bacher
-- 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
--===============5408498560198090974==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="120-glibc-2.43-c23-const.patch"
Description: Fix build with glibc 2.43 (ISO C23 const-preserving string functions)
With glibc 2.43, strchr, strrchr, strpbrk and strstr return a const char *
when passed a const char *, so returning their result from functions
declared to return char * fails with -Werror=discarded-qualifiers.
Cast explicitly, keeping the existing API.
Author: Sebastien Bacher <seb128@ubuntu.com>
Bug-Debian: https://bugs.debian.org/1128549
Forwarded: no
Last-Update: 2026-10-14
Index: ifhp-3.5.20+dfsg/src/safestrutil.c
===================================================================
--- ifhp-3.5.20+dfsg.orig/src/safestrutil.c
+++ ifhp-3.5.20+dfsg/src/safestrutil.c
@@ -80,7 +80,7 @@ int safestrncmp( const char *s1, const c
/* perform safe strchr, even with null pointers */
char *safestrchr( const char *s1, int c )
{
- if( s1 ) return( strchr( s1, c ) );
+ if( s1 ) return( (char *)strchr( s1, c ) );
return( 0 );
}
@@ -88,7 +88,7 @@ char *safestrchr( const char *s1, int c
/* perform safe strrchr, even with null pointers */
char *safestrrchr( const char *s1, int c )
{
- if( s1 ) return( strrchr( s1, c ) );
+ if( s1 ) return( (char *)strrchr( s1, c ) );
return( 0 );
}
@@ -96,7 +96,7 @@ char *safestrrchr( const char *s1, int c
/* perform safe strchr, even with null pointers */
char *safestrpbrk( const char *s1, const char *s2 )
{
- if( s1 && s2 ) return( strpbrk( s1, s2 ) );
+ if( s1 && s2 ) return( (char *)strpbrk( s1, s2 ) );
return( 0 );
}
@@ -104,7 +104,7 @@ char *safestrpbrk( const char *s1, const
/* perform safe strstr, even with null pointers */
char *safestrstr( const char *s1, const char *s2 )
{
- if( s1 && s2 ) return( strstr( s1, s2 ) );
+ if( s1 && s2 ) return( (char *)strstr( s1, s2 ) );
return( 0 );
}
--===============5408498560198090974==--
Technical Details
Message-ID:
<NO2x3-5quY-1@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<NqxVo-a5AF-35@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.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Sebastien Bacher <seb128@ubuntu.com> Newsgroups: linux.debian.bugs.dist Subject: Bug#1128549: ifhp: FTBFS with glibc 2.43 due to ISO C23 const return types Date: Wed, 14 Oct 2026 10:30:01 +0200 Message-ID: <NO2x3-5quY-1@gated-at.bofh.it> References: <NqxVo-a5AF-35@gated-at.bofh.it> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Wed Oct 14 08:25:10 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.651 Reply-To: Sebastien Bacher <seb128@ubuntu.com>, 1128549@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: seb128@ubuntu.com, debian-printing@lists.debian.org X-Debian-Pr-Message: followup 1128549 X-Debian-Pr-Package: src:ifhp X-Debian-Pr-Keywords: ftbfs upstream X-Debian-Pr-Source: ifhp Content-Type: multipart/mixed; boundary="===============5408498560198090974==" 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/1996729 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 101 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Wed, 14 Oct 2026 10:23:15 +0200 X-Original-Message-ID: <179196619549.380831.15186896079021313266.reportbug@seb128-ThinkPad-T16> X-Original-References: <aZjm9kWzkBFtDJgw@aurel32.net>