From: Joseph Myers Date: Wed, 3 Sep 2025 16:30:11 +0000 (+0000) Subject: Fix RISC-V soft-float _FPU_SETCW for GCC 16 set-but-not-used warnings X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=273f80374aeb7d746352a098b23d9bb85e908ea8;p=thirdparty%2Fglibc.git Fix RISC-V soft-float _FPU_SETCW for GCC 16 set-but-not-used warnings 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 --- diff --git a/sysdeps/riscv/fpu_control.h b/sysdeps/riscv/fpu_control.h index 29cf79f2f6..60ea737169 100644 --- a/sysdeps/riscv/fpu_control.h +++ b/sysdeps/riscv/fpu_control.h @@ -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 */