[openwrt/openwrt] tools: e2fsprogs: fix compilation with GCC15

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 8 12:38:28 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/c678cfaa5b00dfca6dbf273892b3184e92d176c3

commit c678cfaa5b00dfca6dbf273892b3184e92d176c3
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun May 18 14:51:12 2025 +0200

    tools: e2fsprogs: fix compilation with GCC15
    
    Backport fix from upstream to fix compilation with host GCC 15.
    https://github.com/tytso/e2fsprogs/commit/49fd04d77b3244c6c6990be41142168eef373aef
    
    Link: https://github.com/openwrt/openwrt/pull/19065
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../004-libext2fs-fix--std=c23-build-failure.patch | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/tools/e2fsprogs/patches/004-libext2fs-fix--std=c23-build-failure.patch b/tools/e2fsprogs/patches/004-libext2fs-fix--std=c23-build-failure.patch
new file mode 100644
index 0000000000..1b05aa7a73
--- /dev/null
+++ b/tools/e2fsprogs/patches/004-libext2fs-fix--std=c23-build-failure.patch
@@ -0,0 +1,38 @@
+From 49fd04d77b3244c6c6990be41142168eef373aef Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi at heitbaum.com>
+Date: Fri, 22 Nov 2024 12:36:32 +0000
+Subject: [PATCH] libext2fs: fix -std=c23 build failure
+
+gcc-15 switched to -std=c23 by default:
+
+    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
+
+As a result `e2fsprogs` fails the build so only typedef int bool
+for __STDC_VERSION__ <= 201710L (C17)
+
+    ../../../lib/ext2fs/tdb.c:113:13: error: two or more data types in declaration specifiers
+    ../../../lib/ext2fs/tdb.c:113:1: warning: useless type name in empty declaration
+      113 | typedef int bool;
+          | ^~~~~~~
+
+https://github.com/tytso/e2fsprogs/issues/202
+
+Signed-off-by: Rudi Heitbaum <rudi at heitbaum.com>
+Link: https://lore.kernel.org/r/Z0B60JhdvT9bpSQ6@6f91903e89da
+Signed-off-by: Theodore Ts'o <tytso at mit.edu>
+---
+ lib/ext2fs/tdb.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/lib/ext2fs/tdb.c
++++ b/lib/ext2fs/tdb.c
+@@ -110,7 +110,9 @@ static char *rep_strdup(const char *s)
+ #endif
+ #endif
+ 
++#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
+ typedef int bool;
++#endif
+ 
+ #include "tdb.h"
+ 




More information about the lede-commits mailing list