]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
unifdef: Don't use C23 constexpr keyword
authorKhem Raj <raj.khem@gmail.com>
Mon, 24 Mar 2025 16:33:22 +0000 (09:33 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 26 Mar 2025 18:45:14 +0000 (18:45 +0000)
Fixes build with GCC-15

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/unifdef/unifdef/0001-Don-t-use-C23-constexpr-keyword.patch [new file with mode: 0644]
meta/recipes-devtools/unifdef/unifdef_2.12.bb

diff --git a/meta/recipes-devtools/unifdef/unifdef/0001-Don-t-use-C23-constexpr-keyword.patch b/meta/recipes-devtools/unifdef/unifdef/0001-Don-t-use-C23-constexpr-keyword.patch
new file mode 100644 (file)
index 0000000..9d02183
--- /dev/null
@@ -0,0 +1,57 @@
+From ca1ac9c8bde84dbdea972299b1a6e30e78c2d785 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 17 Nov 2024 01:26:27 +0000
+Subject: [PATCH] Don't use C23 constexpr keyword
+
+This fixes building with upcoming GCC 15 which defaults to -std=gnu23.
+
+Upstream-Status: Submitted [https://github.com/fanf2/unifdef/pull/19]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ unifdef.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/unifdef.c b/unifdef.c
+index dc145a2..4bd3bda 100644
+--- a/unifdef.c
++++ b/unifdef.c
+@@ -202,7 +202,7 @@ static int              depth;                     /* current #if nesting */
+ static int              delcount;             /* count of deleted lines */
+ static unsigned         blankcount;           /* count of blank lines */
+ static unsigned         blankmax;             /* maximum recent blankcount */
+-static bool             constexpr;            /* constant #if expression */
++static bool             is_constexpr;         /* constant #if expression */
+ static bool             zerosyms;             /* to format symdepth output */
+ static bool             firstsym;             /* ditto */
+@@ -1086,7 +1086,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
+                       *valp = (value[sym] != NULL);
+                       lt = *valp ? LT_TRUE : LT_FALSE;
+               }
+-              constexpr = false;
++              is_constexpr = false;
+       } else if (!endsym(*cp)) {
+               debug("eval%d symbol", prec(ops));
+               sym = findsym(&cp);
+@@ -1103,7 +1103,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
+                       lt = *valp ? LT_TRUE : LT_FALSE;
+                       cp = skipargs(cp);
+               }
+-              constexpr = false;
++              is_constexpr = false;
+       } else {
+               debug("eval%d bad expr", prec(ops));
+               return (LT_ERROR);
+@@ -1170,10 +1170,10 @@ ifeval(const char **cpp)
+       long val = 0;
+       debug("eval %s", *cpp);
+-      constexpr = killconsts ? false : true;
++      is_constexpr = killconsts ? false : true;
+       ret = eval_table(eval_ops, &val, cpp);
+       debug("eval = %d", val);
+-      return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
++      return (is_constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
+ }
+ /*
index 3e08b3a0a45174746c7664ca7b691bf8717100d7..bf0f3e1b17b8b6fe8b265e07c33dcc3faff57709 100644 (file)
@@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3498caf346f6b77934882101749ada23 \
                     file://unifdef.c;endline=32;md5=6f4ee8085d6e6ab0f7cb4390e1a9c497 \
                     "
 
-SRC_URI = "http://dotat.at/prog/${BPN}/${BP}.tar.xz"
+SRC_URI = "http://dotat.at/prog/${BPN}/${BP}.tar.xz \
+           file://0001-Don-t-use-C23-constexpr-keyword.patch"
 SRC_URI[md5sum] = "ae8c0b3b4c43c1f6bc5f32412a820818"
 SRC_URI[sha256sum] = "43ce0f02ecdcdc723b2475575563ddb192e988c886d368260bc0a63aee3ac400"