Skip to contentSkip to conversation

xmlrpc-c: fix build with gcc-15.0.1

PATCH Superseded [email protected] 2 participants 2 messages Apr 2, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xmlrpc-c: fix build with gcc-15.0.1

From: "mark.yang" <[email protected]>

* Fix build error with gcc-15.0.1
http://errors.yoctoproject.org/Errors/Details/850147/
srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
13 | false = 0,
| ^~~~~
srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool' 15 | } bool;
| ^~~~
srcdir/lib/util/include/bool.h:15:3: warning: useless type name in empty declaration In file included from sleep.c:2:
srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
13 | false = 0,
| ^~~~~
srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool' 15 | } bool;
| ^~~~

gcc-15 switched to -std=c23 by default.
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

---
 ...x-bool-reserved-word-error-in-gcc-15.patch | 50 +++++++++++++++++++
 .../xmlrpc-c/xmlrpc-c_1.64.0.bb               |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-bool-reserved-word-error-in-gcc-15.patch
meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-bool-reserved-word-error-in-gcc-15.patch new file +50 -0
new file mode 100644
index 0000000000..3761a68745
@@ -0,0 +1,50 @@
+From a811ea6af5296b89ee7c2a358dd4ffd2584429f4 Mon Sep 17 00:00:00 2001
+From: "mark.yang" <[email protected]>
+Date: Wed, 2 Apr 2025 11:00:27 +0900
+Subject: [PATCH] fix bool reserved word error in gcc 15
+
+* Fix build error with gcc-15.0.1
+  http://errors.yoctoproject.org/Errors/Details/850147/
+    srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
+    13 |     false = 0,
+        |     ^~~~~
+    srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards
+    srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool'
+    15 | } bool;
+        |   ^~~~
+    srcdir/lib/util/include/bool.h:15:3: warning: useless type name in empty declaration
+    In file included from sleep.c:2:
+    srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
+    13 |     false = 0,
+        |     ^~~~~
+    srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards
+    srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool'
+    15 | } bool;
+        |   ^~~~
+
+  gcc-15 switched to -std=c23 by default.
+  https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
+
+Upstream-Status: Submitted [https://github.com/mirror/xmlrpc-c/pull/4]
+Signed-off-by: mark.yang <[email protected]>
+---
+ stable/lib/util/include/bool.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/stable/lib/util/include/bool.h b/stable/lib/util/include/bool.h
+index 312477c4..a5e81eb6 100644
+--- a/stable/lib/util/include/bool.h
++++ b/stable/lib/util/include/bool.h
+@@ -9,10 +9,12 @@
+ /* At least the GNU compiler defines __bool_true_false_are_defined */
+ #ifndef __bool_true_false_are_defined
+ #define __bool_true_false_are_defined
++#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
+ typedef enum {
+     false = 0,
+     true = 1
+ } bool;
+ #endif
+ #endif
++#endif
+ 
meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c_1.64.0.bb +1 -0
index 62ba0f53e6..298c84bb2c 100644
@@ -9,6 +9,7 @@ SRC_URI = "git://github.com/mirror/xmlrpc-c.git;branch=master;protocol=https \
            file://no-automake.patch \
            file://0001-test-cpp-server_abyss-Fix-build-with-clang-libc.patch \
            file://0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch \
+           file://0001-fix-bool-reserved-word-error-in-gcc-15.patch;striplevel=2 \
            "
 # one more commit after Release 1.64.0 in the Stable series
 SRCREV = "8ce36bce2438df9b02fcaafd19efa90a56426601"
#1 lore raw
Quoted 56 lines · mark.yang via lists.openembedded.org

From: "mark.yang" <[email protected]>

* Fix build error with gcc-15.0.1
http://errors.yoctoproject.org/Errors/Details/850147/
srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
13 | false = 0,
| ^~~~~
srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool' 15 | } bool;
| ^~~~
srcdir/lib/util/include/bool.h:15:3: warning: useless type name in empty declaration In file included from sleep.c:2:
srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
13 | false = 0,
| ^~~~~
srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool' 15 | } bool;
| ^~~~

gcc-15 switched to -std=c23 by default.
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

---
 ...x-bool-reserved-word-error-in-gcc-15.patch | 50 +++++++++++++++++++
 .../xmlrpc-c/xmlrpc-c_1.64.0.bb               |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-bool-reserved-word-error-in-gcc-15.patch
meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-bool-reserved-word-error-in-gcc-15.patch new file +18 -0
new file mode 100644
index 0000000000..3761a68745
@@ -0,0 +1,50 @@
+From a811ea6af5296b89ee7c2a358dd4ffd2584429f4 Mon Sep 17 00:00:00 2001
+From: "mark.yang" <[email protected]>
+Date: Wed, 2 Apr 2025 11:00:27 +0900
+Subject: [PATCH] fix bool reserved word error in gcc 15
+
+* Fix build error with gcc-15.0.1
+  http://errors.yoctoproject.org/Errors/Details/850147/
+    srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
+    13 |     false = 0,
+        |     ^~~~~
+    srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards
+    srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool'
+    15 | } bool;
+        |   ^~~~
+    srcdir/lib/util/include/bool.h:15:3: warning: useless type name in empty declaration
+    In file included from sleep.c:2:
+    srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
+    13 |     false = 0,

meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-bool-reserved-word-error-in-gcc-15.patch line 28

Quoted 10 lines
meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-bool-reserved-word-error-in-gcc-15.patch new file +10 -0
+        |     ^~~~~
+    srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards
+    srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool'
+    15 | } bool;
+        |   ^~~~
+
+  gcc-15 switched to -std=c23 by default.
+  https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
+
+Upstream-Status: Submitted [https://github.com/mirror/xmlrpc-c/pull/4]

Thsnks this patch looks good. However it maybe needed to be submitted to the xmlrpc-c mailing list here
https://sourceforge.net/projects/xmlrpc-c/lists/xmlrpc-c-devel

I dont think they accept GH PRs

Quoted 43 lines
meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-bool-reserved-word-error-in-gcc-15.patch new file +22 -0
+Signed-off-by: mark.yang <[email protected]>
+---
+ stable/lib/util/include/bool.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/stable/lib/util/include/bool.h b/stable/lib/util/include/bool.h
+index 312477c4..a5e81eb6 100644
+--- a/stable/lib/util/include/bool.h
++++ b/stable/lib/util/include/bool.h
+@@ -9,10 +9,12 @@
+ /* At least the GNU compiler defines __bool_true_false_are_defined */
+ #ifndef __bool_true_false_are_defined
+ #define __bool_true_false_are_defined
++#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
+ typedef enum {
+     false = 0,
+     true = 1
+ } bool;
+ #endif
+ #endif
++#endif
+
meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c_1.64.0.bb +1 -1
index 62ba0f53e6..298c84bb2c 100644
@@ -9,6 +9,7 @@ SRC_URI = "git://github.com/mirror/xmlrpc-c.git;branch=master;protocol=https \
            file://no-automake.patch \
            file://0001-test-cpp-server_abyss-Fix-build-with-clang-libc.patch \
            file://0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch \
+           file://0001-fix-bool-reserved-word-error-in-gcc-15.patch;striplevel=2 \
            "
 # one more commit after Release 1.64.0 in the Stable series
 SRCREV = "8ce36bce2438df9b02fcaafd19efa90a56426601"
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#116490): https://lists.openembedded.org/g/openembedded-devel/message/116490
Mute This Topic: https://lists.openembedded.org/mt/112039949/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-