* [PATCH] fstests: use '-std=gnu11' to fix build errors with gcc-15
@ 2025-02-10 16:57 Zorro Lang
2025-02-12 6:15 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Zorro Lang @ 2025-02-10 16:57 UTC (permalink / raw)
To: fstests
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).
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
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(-)
diff --git a/include/builddefs.in b/include/builddefs.in
index 7274cde8d..631e5d83f 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -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)
--
2.47.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fstests: use '-std=gnu11' to fix build errors with gcc-15
2025-02-10 16:57 [PATCH] fstests: use '-std=gnu11' to fix build errors with gcc-15 Zorro Lang
@ 2025-02-12 6:15 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2025-02-12 6:15 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests
On Tue, Feb 11, 2025 at 12:57:15AM +0800, Zorro Lang wrote:
> 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).
>
> Signed-off-by: Zorro Lang <zlang@kernel.org>
> ---
>
> 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:
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
>
> Thanks,
> Zorro
>
> include/builddefs.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/builddefs.in b/include/builddefs.in
> index 7274cde8d..631e5d83f 100644
> --- a/include/builddefs.in
> +++ b/include/builddefs.in
> @@ -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)
> --
> 2.47.1
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-12 6:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 16:57 [PATCH] fstests: use '-std=gnu11' to fix build errors with gcc-15 Zorro Lang
2025-02-12 6:15 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox