Thread View: linux.debian.bugs.dist
1 messages
1 total messages
Started by Sebastien Bacher
Wed, 14 Oct 2026 08:30
Bug#1128549: ifhp: FTBFS with glibc 2.43 due to ISO C23 const return types
Author: 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==--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads