From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6DFAB38930E3; Mon, 11 May 2020 13:05:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6DFAB38930E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589202337; bh=b6n2vYRDjur/mvX4iUvOUuldmVJPGJaaS3PIKeln2gA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yAOlX+RUbx7xqMR3wldEDKeG+6kBz9YpXigQb9rsloQE1l7amqca0xzzg2SoRZ0hu qwqQcgB/+qqcLWGmZ/XIFTOe9jbuIsfp+gFxZevVaFIee8oMw/ARqZWaijKnReKCB/ OOeFKgsUB2I8p0jZAb7ayBln0qITe92gplCnTDUY= From: "vincent-gcc at vinc17 dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/95057] missing -Wunused-but-set-variable warning on multiple assignments, not all of them used Date: Mon, 11 May 2020 13:05:37 +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: 10.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: vincent-gcc at vinc17 dot net 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: Mon, 11 May 2020 13:05:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95057 --- Comment #2 from Vincent Lef=C3=A8vre --- (In reply to Jakub Jelinek from comment #1) > That is something this warning can't warn about. > The warning is a simple FE warning that uses two bits, one for whether > certain decl was used and one whether it was read. The warning then > diagnoses those that have the former bit set and not the latter (of cours= e, > there are some exceptions etc.). But when the variable is assigned, the "read" bit could be reset.=