I want to catch equality comparisons of doubles in my code and get warnings for them. Is there a GCC warning that will do this?
It's not something that can be easily grepped for in the source code.
GCC 4.7.0 has:
gcc --help=warnings
and it produces, amongst many others:
-Wfloat-equal Warn if testing floating point numbers for equality
(GCC 4.1.2 does not support the extended help; it 'just' has --help
. It does have the warning option, though.)
A quick man gcc
reveals this as a likely candidate
-Wfloat-equal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With