From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7AD3D3858427; Sat, 9 Apr 2022 00:48:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AD3D3858427 From: "eggert at cs dot ucla.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/44677] Warn for variables incremented but not used Date: Sat, 09 Apr 2022 00:48:33 +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: 4.5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: eggert at cs dot ucla.edu 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: 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: Sat, 09 Apr 2022 00:48:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D44677 eggert at cs dot ucla.edu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |eggert at cs dot ucla.edu --- Comment #13 from eggert at cs dot ucla.edu --- I ran into this issue today on Emacs master, with both +=3D and |=3D. Clang correctly diagnosed unused local variables, but GCC did not. It would be nice if GCC could do at least as well as Clang does. Here are references to patches I installed into Emacs to fix these issues t= hat Clang found but GCC did not: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3Dd9bffa1f3b121085fd= 8f954eb9446a4a5241c062 https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3D68bc1446855c86b96d= 5bc22f819e63358ab250ac=