diff mbox series

[14/24] fpu/soft-fp: Adjust _FP_CMP_CHECK_NAN

Message ID 20180204041136.17525-15-richard.henderson@linaro.org
State New
Headers show
Series re-factor and add fp16 using glibc soft-fp | expand

Commit Message

Richard Henderson Feb. 4, 2018, 4:11 a.m. UTC
The fourth argument to _FP_CMP is a 4-state integer operand that
controls the operation wrt raising exceptions.  However, the usage
that we need within QEMU produces a -Werror=int-in-bool-context:

  error: ?: using integer constants in boolean context, \
  the expression will always evaluate to ‘true’
     glue(FP_CMP_, FS)(r, A, B, float_relation_unordered, (quiet ? 1 : 2));
  note: in definition of macro ‘_FP_CMP_CHECK_NAN’
       if (ex)        \
           ^~

Adding an explicit comparison avoids this.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 fpu/op-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.14.3
diff mbox series

Patch

diff --git a/fpu/op-common.h b/fpu/op-common.h
index c5f33c0148..c4d8b58a03 100644
--- a/fpu/op-common.h
+++ b/fpu/op-common.h
@@ -1242,7 +1242,7 @@ 
     {									\
       /* The arguments are unordered, which may or may not result in	\
 	 an exception.  */						\
-      if (ex)								\
+      if ((ex) != 0)                                                    \
 	{								\
 	  /* At least some cases of unordered arguments result in	\
 	     exceptions; check whether this is one.  */			\