https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105278
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
Keywords| |diagnostic
--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
-Wfloat-equal gets you a warning, as does -Wdouble-promotion:
$ /usr/local/bin/gcc -c -g -O2 -Wall -Wextra -pedantic -Wconversion
-Wfloat-equal -Wdouble-promotion 105278.c
105278.c: In function 'f':
105278.c:5:15: warning: comparing floating-point with '==' or '!=' is unsafe
[-Wfloat-equal]
5 | if (a == 0.1234)
| ^~
105278.c:5:15: warning: implicit conversion from 'float' to 'double' to match
other operand of binary expression [-Wdouble-promotion]
$