From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1577B3858C98; Mon, 11 Mar 2024 12:13:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1577B3858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710159239; bh=4Y29s5q5Xi5JHrvAww1aK1Gs/ADwFrBmkBWifaWAd6c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u/mGrgOku/8LAI53QneXGTTdnUvhikM876TcVM+kRxOIiLv0B2l5WVnpFrJxuWxHn OeQRr0ouYkwIvVvOzXc8/A1A+7i91NLxCRTKmjgQUJEhWLaF3YTohmBQwfGpeHlyHL m1uCmklZbaZwzFz9SGjBYtGjIjtPv1uQysij5SRc= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114306] wrong diagnostic with -Waddress (enabled by -Wall) Date: Mon, 11 Mar 2024 12:13:58 +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: 12.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114306 --- Comment #1 from Andrew Pinski --- I think the warning is correct as: (condA>0 ? cont->value : (int*)NULL) Here cont->value can never be null due to c rules. The above can be simplified to just `condA>0` then. See pr 102967 too.=