https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101649
--- Comment #6 from South Window <make_...@t-online.de> --- Not doing this optimization in -O0 would still leave this warning wrong when optimization is turned on. In my view, the fundamental difference between a generic linter and compiler warnings is that the compiler warning should reflect what the compiler is really doing. If it is not easy to not emit this warning, could it be possible to undo this warning from "elsewhere", or at least to accompany this warning with a withdrawal, e.g. warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion] warning withdrawn: literal '0.5' can be represented without loss of precision as 'float'. Therefore, 'float' precision is used instead of 'double'. [-Wdouble-promotion]