Skip to contentSkip to conversation

include/f2fs_fs.h: fix -std=c23 build failure

PATCH New Nguyen Dat Tho 1 participant 1 message Apr 3, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include/f2fs_fs.h: fix -std=c23 build failure

From: Nguyen Dat Tho <[email protected]>

gcc-15 switched to -std=c23 by default:

    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

As a result f2fs-tools fails as below, so only typedef u8 bool for __STDC_VERSION__ <= 201710L (C17)

In file included from ../../git/lib/libf2fs_zoned.c:11:
../../git/include/f2fs_fs.h:107:25: error: two or more data types in declaration specifiers

  107 | typedef u8              bool;
      |                         ^~~~

../../git/include/f2fs_fs.h:107:1: warning: useless type name in empty declaration
107 | typedef u8 bool;

---
 include/f2fs_fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/f2fs_fs.h +1 -1
index f890634..1be77f1 100644
@@ -103,7 +103,7 @@ typedef uint16_t	u16;
 typedef uint8_t		u8;
 typedef u32		block_t;
 typedef u32		nid_t;
-#ifndef bool
+#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
 typedef u8		bool;
 #endif
 typedef unsigned long	pgoff_t;
Signature · 8 lines
2.34.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel