On 14/11/2007, Patrick R. Michaud <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 14, 2007 at 09:20:40AM -0500, Andy Dougherty wrote:
> > On Tue, 13 Nov 2007, Nicholas Clark via RT wrote:
> > > On Mon, Nov 12, 2007 at 12:33:41PM -0800, Andy Dougherty wrote:
> > > > It may well be there's an issue with gcc's optimizer, since the problem
> > > > goes away without optimization, but I think it's also fair to say that
> > > > the definition of FLOAT_IS_ZERO in include/parrot/misc.h is
> > > > perhaps not optimal here.  I'd prefer the simpler definition:
> > > >
> > > >   #define FLOAT_IS_ZER0(f) ((f) == 0.0)
> > > >
> > > > but I didn't get anywhere last time I proposed that.  I don't know
> > > > what else to do.
> > >
> > > I suggested
> > >
> > >     f >= 0.0 && f <= 0.0
> > >
> > > which I believe is identical, even in the face of NaNs, but should also 
> > > shut
> > > up the whining, er, warning, about comparison.
>
> Yes, as long as whatever expressions we use for "f" don't have any
> side effects (but you both already know this :-).
>
> > You're probably right. However, given that gcc currently throws over a
> > thousand warnings it's hard to get worried about about another one or two.
>
> IIRC, part of the reason we went to some effort to shut up the
> floating point comparison warnings from gcc was because there
> were significantly more than one or two of them.  :-)
>
> But like Andy I've always been strongly in favor of the ((f) == 0.0)
> approach and simply turning off the float_equals warnings in gcc.

The float_equals warnings in gcc *are* off.  So why is this warning a
problem (maybe I've missed something)?  I also don't see over 1000
warnings with gcc (I've got gcc 3.4.5 on Gentoo Linux x86); I have in
the order of 100 atm.  If we *are* seeing over 1000 warnings with gcc,
then either we should turn the warnings level down a bit, or the
warnings should be fixed (like some warnings about required non-null
arguments I know).

Paul

Reply via email to