From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3345D3858D37; Sun, 27 Feb 2022 22:37:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3345D3858D37 From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/104711] Unnecessary -Wshift-negative-value warning Date: Sun, 27 Feb 2022 22:37:08 +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: unknown X-Bugzilla-Keywords: documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: segher at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cf_reconfirmed_on everconfirmed bug_status 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: Sun, 27 Feb 2022 22:37:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104711 Segher Boessenkool changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-02-27 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #2 from Segher Boessenkool --- Our documentation says in As an extension to the C language, GCC does not use the latitude given in= C99 and C11 only to treat certain aspects of signed =E2=80=98<<=E2=80=99 as u= ndefined. However, -fsanitize=3Dshift (and -fsanitize=3Dundefined) will diagnose such cases.= They are also diagnosed where constant expressions are required. It would be much saner / much more practical if we actually implemented thi= s, i.e. don't have -Wshift-negative-value in -Wextra (the above text does not = make much sense if that was the design!) This warning does have a good enough balance between amount of false positi= ves, detection of serious problems, and usefulness to be included in -Wextra. T= he considerations for -Wall and -W are exactly the same, just the bar is lower= for the latter. Confirmed.=