* [PATCH] fstests: workaround for gcc-15
@ 2025-01-17 4:37 Zorro Lang
2025-01-17 17:27 ` Darrick J. Wong
0 siblings, 1 reply; 4+ messages in thread
From: Zorro Lang @ 2025-01-17 4:37 UTC (permalink / raw)
To: fstests; +Cc: linux-fsdevel, linux-xfs
GCC-15 does a big change, it changes the default language version for
C compilation from -std=gnu17 to -std=gnu23. That cause lots of "old
style" C codes hit build errors. On the other word, current xfstests
can't be used with GCC-15. So -std=gnu17 can help that.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
Hi,
I send this patch just for talking about this issue. 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.
So we have to either add -std=$old_version (likes this patch), or port
the code to C23.
This patch is just a workaround (and a reminder for someone might hit
this issue with gcc-15 too). If you have any good suggestions or experience
(for this kind of issue) to share, feel free to reply.
Thanks,
Zorro
include/builddefs.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/builddefs.in b/include/builddefs.in
index 5b5864278..ef124bb87 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=gnu17 -Wall
SANITIZER_CFLAGS += @autovar_init_cflags@
ifeq ($(PKG_PLATFORM),linux)
--
2.47.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] fstests: workaround for gcc-15
2025-01-17 4:37 [PATCH] fstests: workaround for gcc-15 Zorro Lang
@ 2025-01-17 17:27 ` Darrick J. Wong
2025-01-18 14:32 ` Zorro Lang
0 siblings, 1 reply; 4+ messages in thread
From: Darrick J. Wong @ 2025-01-17 17:27 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-fsdevel, linux-xfs
On Fri, Jan 17, 2025 at 12:37:09PM +0800, Zorro Lang wrote:
> GCC-15 does a big change, it changes the default language version for
> C compilation from -std=gnu17 to -std=gnu23. That cause lots of "old
> style" C codes hit build errors. On the other word, current xfstests
> can't be used with GCC-15. So -std=gnu17 can help that.
>
> Signed-off-by: Zorro Lang <zlang@kernel.org>
> ---
>
> Hi,
>
> I send this patch just for talking about this issue. 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.
> So we have to either add -std=$old_version (likes this patch), or port
> the code to C23.
>
> This patch is just a workaround (and a reminder for someone might hit
> this issue with gcc-15 too). If you have any good suggestions or experience
> (for this kind of issue) to share, feel free to reply.
-std=gnu11 to match the kernel and xfsprogs?
--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 5b5864278..ef124bb87 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=gnu17 -Wall
> SANITIZER_CFLAGS += @autovar_init_cflags@
>
> ifeq ($(PKG_PLATFORM),linux)
> --
> 2.47.1
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fstests: workaround for gcc-15
2025-01-17 17:27 ` Darrick J. Wong
@ 2025-01-18 14:32 ` Zorro Lang
2025-01-18 20:14 ` Darrick J. Wong
0 siblings, 1 reply; 4+ messages in thread
From: Zorro Lang @ 2025-01-18 14:32 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Zorro Lang, fstests, linux-fsdevel, linux-xfs
On Fri, Jan 17, 2025 at 09:27:36AM -0800, Darrick J. Wong wrote:
> On Fri, Jan 17, 2025 at 12:37:09PM +0800, Zorro Lang wrote:
> > GCC-15 does a big change, it changes the default language version for
> > C compilation from -std=gnu17 to -std=gnu23. That cause lots of "old
> > style" C codes hit build errors. On the other word, current xfstests
> > can't be used with GCC-15. So -std=gnu17 can help that.
> >
> > Signed-off-by: Zorro Lang <zlang@kernel.org>
> > ---
> >
> > Hi,
> >
> > I send this patch just for talking about this issue. 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.
> > So we have to either add -std=$old_version (likes this patch), or port
> > the code to C23.
> >
> > This patch is just a workaround (and a reminder for someone might hit
> > this issue with gcc-15 too). If you have any good suggestions or experience
> > (for this kind of issue) to share, feel free to reply.
>
> -std=gnu11 to match the kernel and xfsprogs?
So you prefer using a settled "-std=xxx" to changing codes to match "gnu23"?
>
> --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 5b5864278..ef124bb87 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=gnu17 -Wall
> > SANITIZER_CFLAGS += @autovar_init_cflags@
> >
> > ifeq ($(PKG_PLATFORM),linux)
> > --
> > 2.47.1
> >
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fstests: workaround for gcc-15
2025-01-18 14:32 ` Zorro Lang
@ 2025-01-18 20:14 ` Darrick J. Wong
0 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2025-01-18 20:14 UTC (permalink / raw)
To: Zorro Lang; +Cc: Zorro Lang, fstests, linux-fsdevel, linux-xfs
On Sat, Jan 18, 2025 at 10:32:14PM +0800, Zorro Lang wrote:
> On Fri, Jan 17, 2025 at 09:27:36AM -0800, Darrick J. Wong wrote:
> > On Fri, Jan 17, 2025 at 12:37:09PM +0800, Zorro Lang wrote:
> > > GCC-15 does a big change, it changes the default language version for
> > > C compilation from -std=gnu17 to -std=gnu23. That cause lots of "old
> > > style" C codes hit build errors. On the other word, current xfstests
> > > can't be used with GCC-15. So -std=gnu17 can help that.
> > >
> > > Signed-off-by: Zorro Lang <zlang@kernel.org>
> > > ---
> > >
> > > Hi,
> > >
> > > I send this patch just for talking about this issue. 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.
> > > So we have to either add -std=$old_version (likes this patch), or port
> > > the code to C23.
> > >
> > > This patch is just a workaround (and a reminder for someone might hit
> > > this issue with gcc-15 too). If you have any good suggestions or experience
> > > (for this kind of issue) to share, feel free to reply.
> >
> > -std=gnu11 to match the kernel and xfsprogs?
>
> So you prefer using a settled "-std=xxx" to changing codes to match "gnu23"?
Only gcc 14 and 15 support gnu23, which will break the builds on ancient
distros such as Debian 12 and RHEL9. Also, there's the human cost that
now fs developers have to know /two/ C dialects -- gnu11 for the kernel,
and gnu23 for fstests.
So yes, I prefer using -std=gnu11 for better consistency and tooling
support.
--D
> >
> > --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 5b5864278..ef124bb87 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=gnu17 -Wall
> > > SANITIZER_CFLAGS += @autovar_init_cflags@
> > >
> > > ifeq ($(PKG_PLATFORM),linux)
> > > --
> > > 2.47.1
> > >
> > >
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-18 20:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 4:37 [PATCH] fstests: workaround for gcc-15 Zorro Lang
2025-01-17 17:27 ` Darrick J. Wong
2025-01-18 14:32 ` Zorro Lang
2025-01-18 20:14 ` 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