🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.rc
Article #601

Bug#1128761: yambar: FTBFS with glibc 2.43 due to ISO C23 const return types

#601
From: Sebastien Bacher
Date: Wed, 14 Oct 2026 21:40
104 lines
5550 bytes
This is a multi-part MIME message sent by reportbug.


--===============3772739553840754796==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Source: yambar
Followup-For: Bug #1128761
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. There are two spots;
the second one (modules/script.c) isn't in the original log because ninja
stops at the first failure:

 - tag.c: tag_args[] point into the local, writable tag_name_and_arg
   copy, and the code writes a '\0' through the strchr() result, so the
   const on tag_args/arg is just unneeded. Dropped it.
 - modules/script.c: line_end = memchr(line, ...) with a const line;
   line_end is only read, so it is now const char *.

Upstream (codeberg.org/dnkl/yambar) is no longer developed. FWIW the
maintained continuation is maybar (https://codeberg.org/mathstuf/maybar).
It has the same two spots: they were reported as maybar #40/#41 and closed
as "C23 only". But glibc 2.43 triggers them even with the -std=c18 the
package already builds with, as your build log shows.

We are carrying it in Ubuntu as yambar 1.11.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

--===============3772739553840754796==
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 build with glibc 2.43 (ISO C23 const-preserving strchr/memchr)
 glibc 2.43 makes strchr() and memchr() return a const-qualified pointer
 when passed a const-qualified one, which -Werror turns into build failures:
  - tag.c: tag_args[] point into the local, writable tag_name_and_arg copy
    and the code writes a '\0' through the strchr() result, so drop the
    unneeded const from tag_args/arg.
  - modules/script.c: line_end is only read, make it const.
Author: Sebastien Bacher <seb128@ubuntu.com>
Bug-Debian: https://bugs.debian.org/1128761
Forwarded: not-needed
Last-Update: 2026-10-14

--- a/tag.c
+++ b/tag.c
@@ -476,7 +476,7 @@
 
         static const size_t MAX_TAG_ARGS = 4;
         const char *tag_name = NULL;
-        const char *tag_args[MAX_TAG_ARGS];
+        char *tag_args[MAX_TAG_ARGS];
         memset(tag_args, 0, sizeof(tag_args));
 
         {
@@ -484,7 +484,7 @@
             tag_name = strtok_r(tag_name_and_arg, ":", &saveptr);
 
             for (size_t i = 0; i < MAX_TAG_ARGS; i++) {
-                const char *arg = strtok_r(NULL, ":", &saveptr);
+                char *arg = strtok_r(NULL, ":", &saveptr);
                 if (arg == NULL)
                     break;
                 tag_args[i] = arg;
--- a/modules/script.c
+++ b/modules/script.c
@@ -265,7 +265,7 @@
     size_t idx = 0;
 
     while (left > 0) {
-        char *line_end = memchr(line, '\n', left);
+        const char *line_end = memchr(line, '\n', left);
         assert(line_end != NULL);
 
         size_t line_len = line_end - line;

--===============3772739553840754796==--
Technical Details
Message-ID: <NOeRz-5xho-5@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.hispagatos.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <Nqy53-a5EK-31@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.hispagatos.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Sebastien Bacher <seb128@ubuntu.com>
Newsgroups: linux.debian.bugs.rc
Subject: Bug#1128761: yambar: 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-5@gated-at.bofh.it>
References: <Nqy53-a5EK-31@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <1128761@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-rc-request@lists.debian.org  Wed Oct 14 21:37:12 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.651
Reply-To: Sebastien Bacher <seb128@ubuntu.com>, 1128761@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: seb128@ubuntu.com, birger@debian.org
X-Debian-Pr-Message: followup 1128761
X-Debian-Pr-Package: src:yambar
X-Debian-Pr-Keywords: ftbfs sid upstream forky
X-Debian-Pr-Source: yambar
Content-Type: multipart/mixed; boundary="===============3772739553840754796=="
MIME-Version: 1.0
X-Mailer: reportbug 13.2.0+ubuntu1
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-rc@lists.debian.org> archive/latest/834542
List-ID: <debian-bugs-rc.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-rc/>
Approved: robomod@news.nic.it
Lines: 104
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed, 14 Oct 2026 23:34:47 +0200
X-Original-Message-ID: <179201368798.497021.5918597202712986213.reportbug@seb128-ThinkPad-T16>
X-Original-References: <aZssYm0udF09XGPE@aurel32.net>