[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Opcodes warning messages clean up
From: |
Hans-Bernhard Broeker |
Subject: |
Re: Opcodes warning messages clean up |
Date: |
20 Sep 2001 16:29:36 GMT |
Nick Clifton <address@hidden> wrote:
> opcodes/tic30-dis.c: In function `cnvt_tmsfloat_ieee':
> opcodes/tic30-dis.c:691: warning: division: function singularity
> opcodes/tic30-dis.c:693: warning: division: function singularity
Interesting warning, that is. I never saw that one before. :-)
> I am not sure how to resolve these two. They come from this code:
> if (sign == 0)
> *ieeefloat = 1.0 / 0.0;
> else
> *ieeefloat = -1.0 / 0.0;
> Any suggetsions ?
If I'm not being totally dumb today, you can remove the whole block:
it's unreachable. Notice how it reads the following a few lines
before:
exp = tmsfloat & 0xFF000000;
if (exp == 0x80000000)
{
*ieeefloat = 0.0;
return 1;
}
exp += 0x7F000000;
sign = (tmsfloat & 0x00800000) << 8;
mant = tmsfloat & 0x007FFFFF;
if (exp == 0xFF000000)
{
/* the code you quoted is in here */
}
AFAICS, the only way exp == 0xff000000 can happen is if we came into
this with exp == 0x80000000, but then the first if() would have kicked
in already.
--
Hans-Bernhard Broeker (address@hidden)
Even if all the snow were burnt, ashes would remain.