This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Fourth Draft "Unsafe fp optimizations" project description.
- To: syedali011 at earthlink dot net
- Subject: Re: Fourth Draft "Unsafe fp optimizations" project description.
- From: Brad Lucier <lucier at math dot purdue dot edu>
- Date: Wed, 15 Aug 2001 11:01:24 -0500 (EST)
- Cc: lucier at math dot purdue dot edu (Brad Lucier), gcc at gcc dot gnu dot org, ejr at cs dot berkeley dot edu, kaih at khms dot westfalen dot de
Re:
> if there going to be doing stuff like
> if (a_float == someinteger)
>
> imho this should be flagged off as a warning?
There *is* a warning that does this in gcc-3.0:
banach-292% gcc -Wfloat-equal -c test.c
test.c: In function `test':
test.c:4: warning: comparing floating point with == or != is unsafe
banach-293% cat test.c
int
test (float a, int b)
{
return a == b;
}
Brad Lucier