diff mbox series

[f2fs-dev] include/f2fs_fs.h: fix -std=c23 build failure

Message ID 20250403035057.304454-1-thond2009@gmail.com (mailing list archive)
State Superseded
Headers show
Series [f2fs-dev] include/f2fs_fs.h: fix -std=c23 build failure | expand

Commit Message

Nguyen Dat Tho April 3, 2025, 3:50 a.m. UTC
From: Nguyen Dat Tho <tho3.nguyen@lge.com>

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;

Signed-off-by: Nguyen Dat Tho <tho3.nguyen@lge.com>
---
 include/f2fs_fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index f890634..1be77f1 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -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;