Floating point performance issue

Miles Bader miles@gnu.org
Thu Dec 22 03:23:00 GMT 2011


2011/12/21 David Brown <david@westcontrol.com>:
> I think our key difference of opinion here is that you want a warning only
> when it is quite clear that "something dodgy" is happening - I want the
> warning unless it is quite clear that something dodgy is /not/ happening.

Er, well feel free to turn on the warning for code you write...

But the _default_ settings (and what's included in "catch-all" options
like -Wall) are something altogether different.  They are a balancing
act, and must take into account many different programming styles, and
avoid excessive false positives[1], which are quite annoying,
especially when there isn't a clear alternative to what's being warned
about[2].  False negatives are less of an issue, as typically
"something is better than nothing"...

[1] Yes, in this case, a warning about a valid comparison _is_ a false
positive; the warning says "this is unsafe" for a comparison that is
safe

[2] E.g., "if (x = ...)" can be trivially rewritten as "x = ..; if
(x)", and doing so generally improves code readability without any
runtime penalty; however this isn't true for all constructs

-miles

-- 
Cat is power.  Cat is peace.



More information about the Gcc-help mailing list