[Bug c++/105278] no warning for precise literals compared with floats

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Thu Apr 14 19:43:28 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105278

--- Comment #4 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Eric Gallager from comment #3)
> (In reply to David Binderman from comment #2)
> > (In reply to Eric Gallager from comment #1)
> > > -Wfloat-equal gets you a warning, as does -Wdouble-promotion:
> > 
> > Thanks for that. This looks like another case where an obscure flag
> > really ought to be in -Wall or at least -Wextra.
> > 
> > I'll be adding it into my local compiler.
> 
> Which one of them specifically do you want as part of -Wall or -Wextra?
> Because the latter is listed explicitly in some documentation somewhere as
> an example of a flag that would be bad to include in -Wall or -Wextra.

Sorry, I should have been more clear -Wfloat-equal. I haven't looked into
the pros and cons of -Wdouble-promotion. 

If you've got some spare time to pin down "some documentation somewhere",
then that would be appreciated.


More information about the Gcc-bugs mailing list