Skip to contentSkip to conversation

composefs: Fix incompatible pointer type qualifier mismatches

PATCH New Khem Raj 1 participant 4 messages Apr 16

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 composefs: Fix incompatible pointer type qualifier mismatches

---
 ...-const-char-for-memchr-return-values.patch | 45 +++++++++++++++++++
 .../composefs/composefs_1.0.8.bb              |  5 ++-
 2 files changed, 48 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-support/composefs/composefs/0001-mkcomposefs-use-const-char-for-memchr-return-values.patch
meta-oe/recipes-support/composefs/composefs/0001-mkcomposefs-use-const-char-for-memchr-return-values.patch new file +45 -0
new file mode 100644
index 0000000000..9c45d4fcc0
@@ -0,0 +1,45 @@
+From 9d82303c7a3a780d481469cd8eafa016dcbff86f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 16 Apr 2026 08:25:28 -0700
+Subject: [PATCH] mkcomposefs: use const char* for memchr return values
+
+memchr returns void*, which when assigned to char* discards the
+const qualifier of the input pointer. Cast to const char* to
+preserve const'ness.
+
+Fixes build with clang-22/glibc-2.43
+
+tools/mkcomposefs.c
+../sources/composefs-1.0.8/tools/mkcomposefs.c:413:8: error: initializing 'char *' with an expression of type 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
+  413 |         char *embedded_nul_offset = memchr(line, 0, line_len);
+      |               ^                     ~~~~~~~~~~~~~~~~~~~~~~~~~
+1 error generated.
+
+Upstream-Status: Submitted [https://github.com/composefs/composefs/pull/435]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tools/mkcomposefs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/mkcomposefs.c b/tools/mkcomposefs.c
+index 13b505d..e14d8d0 100644
+--- a/tools/mkcomposefs.c
++++ b/tools/mkcomposefs.c
+@@ -63,7 +63,7 @@ static __attribute__((format(printf, 1, 2))) char *make_error(const char *fmt, .
+ static size_t split_at(const char **start, size_t *length, char split_char,
+ 		       bool *partial)
+ {
+-	char *end = memchr(*start, split_char, *length);
++	const char *end = (const char*)memchr(*start, split_char, *length);
+ 	if (end == NULL) {
+ 		size_t part_len = *length;
+ 		*start = *start + *length;
+@@ -410,7 +410,7 @@ static char *tree_from_dump_line(dump_info *info, const char *line,
+ 	 * We didn't document support for embedded NULs, and it only introduces
+ 	 * ambiguity in parsing, so let's just reject this early on.
+ 	 */
+-	char *embedded_nul_offset = memchr(line, 0, line_len);
++	const char *embedded_nul_offset = (const char*)memchr(line, 0, line_len);
+ 	if (embedded_nul_offset != NULL) {
+ 		size_t off = embedded_nul_offset - line;
+ 		return make_error("Invalid embedded NUL character at position %lld",
meta-oe/recipes-support/composefs/composefs_1.0.8.bb +3 -2
index f2bae91f44..3450f9a339 100644
@@ -14,8 +14,9 @@ LIC_FILES_CHKSUM = "\
 "
 
 SRCREV = "858ce1b38e1534c2602eb431124b5dca706bc746"
-SRC_URI = "git://github.com/containers/composefs.git;protocol=https;branch=main"
-
+SRC_URI = "git://github.com/containers/composefs.git;protocol=https;branch=main;tag=v${PV} \
+           file://0001-mkcomposefs-use-const-char-for-memchr-return-values.patch \
+          "
 
 inherit meson
 
author
#1 lore raw

PATCH 2/4 streamripper: disable C23 support to fix configure check

Set ac_cv_prog_cc_c23=no to prevent autoconf from detecting C23 compiler support, avoiding potential build failures as the package is not yet fully ported to support C23 standard.

---
 .../recipes-multimedia/streamripper/streamripper_1.64.6.bb      | 2 ++
 1 file changed, 2 insertions(+)
meta-multimedia/recipes-multimedia/streamripper/streamripper_1.64.6.bb +2 -0
index 1600d9d3ef..480c132473 100644
@@ -20,6 +20,8 @@ SRC_URI[sha256sum] = "c1d75f2e9c7b38fd4695be66eff4533395248132f3cc61f375196403c4
 
 inherit autotools pkgconfig
 
+CACHED_CONFIGUREVARS += "ac_cv_prog_cc_c23=no"
+
 EXTRA_OECONF += "--with-included-argv=yes --with-included-libmad=no"
 EXTRA_OECONF += "\
     --with-ogg-includes=${STAGING_INCDIR} \
author
#2 lore raw

PATCH v2 3/4 magic-enum: Upgrade to latest

In reply to Khem Raj

It has fixes for C23 and Clang-22 added also fixes/workarounds for libstdc++-14 combinations with different versions of gcc and clang.

---
v2: Bump to include clang-22 fixes

 meta-oe/recipes-extended/magic-enum/magic-enum_0.9.7.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta-oe/recipes-extended/magic-enum/magic-enum_0.9.7.bb +2 -1
index 6d5399c8d0..958ae21065 100644
@@ -16,7 +16,8 @@ SRC_URI = " \
     file://run-ptest \
 "
 
-SRCREV = "e046b69a3736d314fad813e159b1c192eaef92cd"
+SRCREV = "7d87efb4a3dddbbe8caa9ca14eff05ede1102ab8"
+PV .= "+git"
 
 inherit cmake ptest
 
author
#3 lore raw

PATCH 4/4 libtoml11: Fix build with C23 and clang

In reply to Khem Raj
---
 ...move-more-whitespaces-after-operator.patch | 34 +++++++++++++++++++
 .../libtoml11/libtoml11_4.4.0.bb              |  3 ++
 2 files changed, 37 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/libtoml11/files/0001-Remove-more-whitespaces-after-operator.patch
meta-oe/recipes-devtools/libtoml11/files/0001-Remove-more-whitespaces-after-operator.patch new file +34 -0
new file mode 100644
index 0000000000..5bff81eaf6
@@ -0,0 +1,34 @@
+From 6af7de3d5eaae59c53c42aab8eca1e1e9a365da5 Mon Sep 17 00:00:00 2001
+From: Steffen Winter <[email protected]>
+Date: Thu, 25 Dec 2025 20:48:02 +0100
+Subject: [PATCH] Remove more whitespaces after operator""
+
+Upstream-Status: Submitted [https://github.com/ToruNiina/toml11/pull/306]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ include/toml11/fwd/literal_fwd.hpp   | 4 ++--
+ include/toml11/impl/literal_impl.hpp | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/include/toml11/fwd/literal_fwd.hpp
++++ b/include/toml11/fwd/literal_fwd.hpp
+@@ -24,7 +24,7 @@ inline namespace toml_literals
+ #if defined(TOML11_HAS_CHAR8_T)
+ // value of u8"" literal has been changed from char to char8_t and char8_t is
+ // NOT compatible to char
+-::toml::value operator"" _toml(const char8_t* str, std::size_t len);
++::toml::value operator""_toml(const char8_t* str, std::size_t len);
+ #endif
+
+ } // toml_literals
+--- a/include/toml11/impl/literal_impl.hpp
++++ b/include/toml11/impl/literal_impl.hpp
+@@ -146,7 +146,7 @@ operator""_toml(const char* str, std::si
+ // value of u8"" literal has been changed from char to char8_t and char8_t is
+ // NOT compatible to char
+ TOML11_INLINE ::toml::value
+-operator"" _toml(const char8_t* str, std::size_t len)
++operator""_toml(const char8_t* str, std::size_t len)
+ {
+     if(len == 0)
+     {
meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb +3 -0
index 7e097e4612..c0a550b910 100644
@@ -16,12 +16,15 @@ PE = "1"
 SRC_URI = "\
     gitsm://github.com/ToruNiina/toml11.git;protocol=https;branch=main;tag=v${PV} \
     file://0001-Remove-whitespace-in-operator.patch \
+    file://0001-Remove-more-whitespaces-after-operator.patch \
     file://run-ptest \
 "
 SRCREV = "be08ba2be2a964edcdb3d3e3ea8d100abc26f286"
 
 inherit cmake ptest
 
+CXXFLAGS += "-Wno-error=c2y-extensions"
+
 EXTRA_OECMAKE += "-DTOML11_PRECOMPILE=ON \
                   -DTOML11_BUILD_TESTS=${@bb.utils.contains("PTEST_ENABLED", "1", "ON", "OFF", d)} \
 "