Re: Floating point performance issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/12/11 01:27, Miles Bader wrote:
David Brown<david@xxxxxxxxxxxxxxx>  writes:
Making "-Wfloat-equal" a default flag would eliminate many of these
mistakes.

It also results in false positives, so it shouldn't be on by default.

[E.g. "float x = 0;  .... y = x; ... if (y == 0) ..." should not result
in a warning.]

-Miles


I gather (from the bug report mentioned by Vincent Lefevre) that code like this will not always give the result you expect - so the compiler should definitely warn in such cases. (Alternatively the compiler could be changed so that such code is always consistent regardless of architecture, floating point options, and optimisation options - I suspect giving a warning is easier.)

mvh.,

David


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux