From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5728A3858C52; Fri, 3 Feb 2023 17:58:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5728A3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675447131; bh=pEhkt8BE9LL6LmGi8vT8Wtf0+sPrTnFjcj4ueANDjZ8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Z+jhfKv2m8jIyC2l34hxHSYDHvhUPxLttNNjGDmzAE6dzzt15xqBGTqfD7kXvWsBF liCgTtIeiVEVPlbMbWDTXHq0gvlxl1lXfT5WSjtV1N1AnuwlHVjLdZxaBqa6Gl7pia VSmoQ6TCghOqJs7lkC+rFGbdKtE80A5k+KGJbUyg= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108646] nonnull attribute does not detect variables that are NULL being passed Date: Fri, 03 Feb 2023 17:58:50 +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: redi at gcc dot gnu.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 #4 from Jonathan Wakely --- (In reply to Jonny Grant from comment #3) > Is it worth -Wnonnull emitting a warning message that it needs optimizati= on > to get the needed data flow analysis? No, there are dozens of warnings that work poorly, or not at all, unless optimization is enabled. It's in the manual. "The effectiveness of some warnings depends on optimizations also being enabled. For example -Wsuggest-final-types is more effective with link-time 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."=