From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2AB543858D33; Tue, 7 Feb 2023 12:20:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AB543858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675772400; bh=sECzIYkgHsqZ313wKcn4gJEArSLIS/drKp2y9nUz/kY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ncCokYa6DGS6IMe8fhnP69IeTiwKEGyAxCzLb+Jny73rDcRH/hS1mjVxFA6sBgP2X p1Bhr1wKhduZuYPkENKHGVPl9n7Gb3nBlY/s9/ySqWhWU3B6YCZIV4URIpe+kKHeOj trpKufJjHby3OIZ9dgrespwhtIA10I6NMTXh3Ock= From: "jg at jguk dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108646] nonnull attribute does not detect variables that are NULL being passed Date: Tue, 07 Feb 2023 12:19:59 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: jg at jguk dot org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE 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=3D108646 --- Comment #5 from Jonny Grant --- (In reply to Jonathan Wakely from comment #4) > (In reply to Jonny Grant from comment #3) > > Is it worth -Wnonnull emitting a warning message that it needs optimiza= tion > > to get the needed data flow analysis? >=20 > No, there are dozens of warnings that work poorly, or not at all, unless > optimization is enabled. It's in the manual. >=20 > "The effectiveness of some warnings depends on optimizations also being > enabled. For example -Wsuggest-final-types is more effective with link-ti= me > optimization and some instances of other warnings may not be issued at all > unless optimization is enabled. While optimization in general improves the > efficacy of control and data flow sensitive warnings, in some cases it may > also cause false positives." Ok I see. Thank you for clarifying.=