From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4EF533846441; Wed, 26 Oct 2022 08:47:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4EF533846441 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666774066; bh=3GSpt/R4LPonEkznY262a6b+TfAvU2Evm10U2MuQaXM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pmZtBwXfpXej7IOiBggxWaLWk9FoR8FoYx7KDzxOtFAWJuiNZrEJ9mmxDnvdyo0eP t9qU4xbxO41WPha1M/Mbc9ZFNCEa+BtPMoFGmfFRjUKs+IqOJdJ2G7kFTgyLq/KVQh U5IqBBmjpdX5aw0MuJzgp7yBCQseKPLaQf6BxTKs= From: "vincent-gcc at vinc17 dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95148] -Wtype-limits always-false warning triggered despite comparison being avoided Date: Wed, 26 Oct 2022 08:47:46 +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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95148 Vincent Lef=C3=A8vre changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vincent-gcc at vinc17 dot = net --- Comment #2 from Vincent Lef=C3=A8vre --- Simpler code, also for C: int f (void) { unsigned int x =3D 5; return 0 && x < 0 ? 1 : 0; } Alternatively: int f (void) { unsigned int x =3D 5; if (0) return x < 0 ? 1 : 0; return 0; } With -Wtype-limits, GCC 12.2.0 warns on both.=