This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fourth Draft "Unsafe fp optimizations" project description.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]