From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 052163858D3C; Wed, 1 Dec 2021 00:28:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 052163858D3C From: "egallager at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/103502] -Wstrict-aliasing=3 doesn't warn on what is documented as UB Date: Wed, 01 Dec 2021 00:28:34 +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: 11.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: egallager at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: cc 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: Wed, 01 Dec 2021 00:28:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103502 Eric Gallager changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |egallager at gcc dot gnu.o= rg --- Comment #6 from Eric Gallager --- (In reply to Andrew Pinski from comment #1) > The documentation > (https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options) > for the warning is clear here: > "Takes care of the common pun+dereference pattern in the front end: > *(int*)&some_float. " >=20 > >3 is documented as the most precise option >=20 > I think you misunderstood what precise means in this context really. > "Higher levels correspond to higher accuracy (fewer false positives). " -Wstrict-aliasing is kind of confusing in this regards since it's different from how other warnings with numerical levels work. Normally a higher numer= ical value to a warning option means "print more warnings" but for -Wstrict-alia= sing it means "try harder to reduce the number of warnings". Perhaps this is an inconsistency that should be rectified?=