]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix RISC-V soft-float _FPU_SETCW for GCC 16 set-but-not-used warnings
authorJoseph Myers <josmyers@redhat.com>
Wed, 3 Sep 2025 16:30:11 +0000 (16:30 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 13 Sep 2025 14:11:44 +0000 (07:11 -0700)
The soft-float RISC-V definition of _FPU_SETCW results in a
-Werror=unused-but-set-variable= build failure with GCC mainline (in
math/setfpucw.c) because it does not use the dummy cw variable.
Change it to (void) (cw) as on other architectures to avoid this build
failure.

Tested with build-many-glibcs.py (compilers) for
riscv64-linux-gnu-rv64imac-lp64, which previously failed.
Reviewed-by: Sam James <sam@gentoo.org>
sysdeps/riscv/fpu_control.h

index 29cf79f2f63879d2792c5239eff1a18cbde18cfb..60ea7371690a0b31481ee35eaa96aedf1913e63c 100644 (file)
@@ -27,7 +27,7 @@
 # define _FPU_DEFAULT  0x00000000
 typedef unsigned int fpu_control_t;
 # define _FPU_GETCW(cw) (cw) = 0
-# define _FPU_SETCW(cw) do { } while (0)
+# define _FPU_SETCW(cw) (void) (cw)
 extern fpu_control_t __fpu_control;
 
 #else /* __riscv_flen */