From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 767083858C53; Thu, 14 Apr 2022 19:43:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 767083858C53 From: "dcb314 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105278] no warning for precise literals compared with floats Date: Thu, 14 Apr 2022 19:43:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: dcb314 at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2022 19:43:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105278 --- Comment #4 from David Binderman --- (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: > >=20 > > Thanks for that. This looks like another case where an obscure flag > > really ought to be in -Wall or at least -Wextra. > >=20 > > I'll be adding it into my local compiler. >=20 > 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.=20 If you've got some spare time to pin down "some documentation somewhere", then that would be appreciated.=