This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: Fix warning in opcodes
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Mon, 20 Jun 2005 11:18:17 -0700
- Subject: PATCH: Fix warning in opcodes
I got
cc1: warnings being treated as errors
/net/gnu/export/gnu/src/binutils-import/binutils/opcodes/tic30-dis.c: In
function `cnvt_tmsfloat_ieee':
/net/gnu/export/gnu/src/binutils-import/binutils/opcodes/tic30-dis.c:695:
warning: division: function singularity
/net/gnu/export/gnu/src/binutils-import/binutils/opcodes/tic30-dis.c:697:
warning: division: function singularity
make[5]: *** [tic30-dis.lo] Error 1
This patch fixes it.
H.J.
----
2005-06-20 H.J. Lu <hongjiu.lu@intel.com>
* tic30-dis.c (cnvt_tmsfloat_ieee): Use HUGE_VALF if defined.
--- opcodes/tic30-dis.c.warn 2005-05-07 06:58:05.000000000 -0700
+++ opcodes/tic30-dis.c 2005-06-20 11:17:11.000000000 -0700
@@ -691,10 +691,17 @@ cnvt_tmsfloat_ieee (tmsfloat, size, ieee
{
if (mant == 0)
*ieeefloat = ERANGE;
+#ifdef HUGE_VALF
+ if (sign == 0)
+ *ieeefloat = HUGE_VALF;
+ else
+ *ieeefloat = -HUGE_VALF;
+#else
if (sign == 0)
*ieeefloat = 1.0 / 0.0;
else
*ieeefloat = -1.0 / 0.0;
+#endif
return 1;
}
exp >>= 1;