Hi Bruno,

I've pushed the 2 attached patches fixing a minor bug in your
strn?casecmp_l implementations from a few months ago.

On systems where Gnulib defines a locale_t, we need to include
c-strcase.h for the c_strn?casecmp functions, which are used if the
given locale is the C locale.

This is a warning on the CI because of the GCC version it uses. But it
becomes an error in GCC 14 [1].

Collin

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91092

>From 202ba7a9ee4f2bf15f2cee7d0b3d2ad6081dfe00 Mon Sep 17 00:00:00 2001
Message-ID: <202ba7a9ee4f2bf15f2cee7d0b3d2ad6081dfe00.1751683475.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Fri, 4 Jul 2025 19:34:06 -0700
Subject: [PATCH 1/2] strcasecmp_l: Fix missing declaration of c_strcasecmp
 (regr. 2025-02-16).

* lib/strcasecmp_l.c [GNULIB_defined_locale_t]: Include c-strcase.h.
---
 ChangeLog          | 3 +++
 lib/strcasecmp_l.c | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 7b9e2710c5..5d4b89ac15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2025-07-04  Collin Funk  <collin.fu...@gmail.com>
 
+	strcasecmp_l: Fix missing declaration of c_strcasecmp (regr. 2025-02-16).
+	* lib/strcasecmp_l.c [GNULIB_defined_locale_t]: Include c-strcase.h.
+
 	forkpty: Adjust misleading comment.
 	* lib/forkpty.c: Remove comment about mingw where it does not build.
 
diff --git a/lib/strcasecmp_l.c b/lib/strcasecmp_l.c
index 07ffee2f7f..2901d12064 100644
--- a/lib/strcasecmp_l.c
+++ b/lib/strcasecmp_l.c
@@ -23,6 +23,10 @@
 #include <limits.h>
 #include <string.h>
 
+#if GNULIB_defined_locale_t
+# include <c-strcase.h>
+#endif
+
 int
 strcasecmp_l (const char *s1, const char *s2, locale_t locale)
 {
-- 
2.50.0

>From eab78ca4765aea66a1148af92bf0b5d9611901aa Mon Sep 17 00:00:00 2001
Message-ID: <eab78ca4765aea66a1148af92bf0b5d9611901aa.1751683475.git.collin.fu...@gmail.com>
In-Reply-To: <202ba7a9ee4f2bf15f2cee7d0b3d2ad6081dfe00.1751683475.git.collin.fu...@gmail.com>
References: <202ba7a9ee4f2bf15f2cee7d0b3d2ad6081dfe00.1751683475.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Fri, 4 Jul 2025 19:36:50 -0700
Subject: [PATCH 2/2] strncasecmp_l: Fix missing declaration of c_strncasecmp
 (regr. 2025-02-16).

* lib/strncasecmp_l.c [GNULIB_defined_locale_t]: Include c-strcase.h.
---
 ChangeLog           | 3 +++
 lib/strncasecmp_l.c | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 5d4b89ac15..2d52118881 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2025-07-04  Collin Funk  <collin.fu...@gmail.com>
 
+	strncasecmp_l: Fix missing declaration of c_strncasecmp (regr. 2025-02-16).
+	* lib/strncasecmp_l.c [GNULIB_defined_locale_t]: Include c-strcase.h.
+
 	strcasecmp_l: Fix missing declaration of c_strcasecmp (regr. 2025-02-16).
 	* lib/strcasecmp_l.c [GNULIB_defined_locale_t]: Include c-strcase.h.
 
diff --git a/lib/strncasecmp_l.c b/lib/strncasecmp_l.c
index 04219c5c95..9e2594a5c9 100644
--- a/lib/strncasecmp_l.c
+++ b/lib/strncasecmp_l.c
@@ -23,6 +23,10 @@
 #include <limits.h>
 #include <string.h>
 
+#if GNULIB_defined_locale_t
+# include <c-strcase.h>
+#endif
+
 int
 strncasecmp_l (const char *s1, const char *s2, size_t n, locale_t locale)
 {
-- 
2.50.0

Reply via email to