Skip to contentSkip to conversation

fstests: use '-std=gnu11' to fix build errors with gcc-15

PATCH In review Zorro Lang 2 participants 2 messages Feb 10, 2025 – Feb 12, 2025

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 fstests: use '-std=gnu11' to fix build errors with gcc-15

GCC-15 does a big change, it changes the default C compilation language standard to -std=gnu23. That cause lots of "old style" C codes hit building errors. On the other word, current xfstests can't be used with GCC-15. So use a fixed language standard -- "-std=gnu11" (to match the kernel and xfsprogs).

---

Hi,

The upcoming gcc-15 does lots of changes, a big change is using C23 by default:

https://gcc.gnu.org/gcc-15/porting_to.html

xfstests has many old style C codes, they hard to be built with gcc-15.

Thanks,
Zorro

 include/builddefs.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/builddefs.in +1 -1
index 7274cde8d..631e5d83f 100644
@@ -75,7 +75,7 @@ HAVE_RLIMIT_NOFILE = @have_rlimit_nofile@
 NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE = @need_internal_xfs_ioc_exchange_range@
 HAVE_FICLONE = @have_ficlone@
 
-GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
+GCCFLAGS = -funsigned-char -fno-strict-aliasing -std=gnu11 -Wall
 
 ifeq ($(PKG_PLATFORM),linux)
 PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(GCCFLAGS)
Signature · 1 line
2.47.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Zorro Lang

GCC-15 does a big change, it changes the default C compilation language standard to -std=gnu23. That cause lots of "old style" C codes hit building errors. On the other word, current xfstests can't be used with GCC-15. So use a fixed language standard -- "-std=gnu11" (to match the kernel and xfsprogs).

---

Quoted 8 lines

Hi,

The upcoming gcc-15 does lots of changes, a big change is using C23 by default:

https://gcc.gnu.org/gcc-15/porting_to.html

xfstests has many old style C codes, they hard to be built with gcc-15.

Quick question -- does the same need to be applied to CXXFLAGS? There aren't any C++ modules in fstests, but it'd be nice not to leave a weirdness where cpp files aren't built with a roughly contemporaneous language specification.

That said, this at least gets us to the same behavior as the linux kernel and xfsprogs, so:

--D

Quoted 24 lines

Thanks,
Zorro

 include/builddefs.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/builddefs.in +1 -1
index 7274cde8d..631e5d83f 100644
@@ -75,7 +75,7 @@ HAVE_RLIMIT_NOFILE = @have_rlimit_nofile@
 NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE = @need_internal_xfs_ioc_exchange_range@
 HAVE_FICLONE = @have_ficlone@
 
-GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
+GCCFLAGS = -funsigned-char -fno-strict-aliasing -std=gnu11 -Wall
 
 ifeq ($(PKG_PLATFORM),linux)
 PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(GCCFLAGS)
Signature · 1 line
2.47.1