Fourth Draft "Unsafe fp optimizations" project description.

Brad Lucier lucier@math.purdue.edu
Wed Aug 15 09:01:00 GMT 2001


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



More information about the Gcc mailing list