From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 43C5C396EC4F; Tue, 9 Feb 2021 17:19:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43C5C396EC4F From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/99028] diagnostic path is too verbose Date: Tue, 09 Feb 2021 17:19:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm 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: Tue, 09 Feb 2021 17:19:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99028 --- Comment #2 from David Malcolm --- At -fanalyzer-verbosity=3D1 and below, we only show those two events: In function =E2=80=98add_to_trie=E2=80=99: ../../src/gcc/testsuite/gcc.dg/analyzer/pr99028.c:175:28: warning: derefere= nce of possibly-NULL =E2=80=98child=E2=80=99 [CWE-690] [-Wanalyzer-possible-nul= l-dereference] 175 | child->len =3D root->len - i - 1; | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ =E2=80=98add_to_trie=E2=80=99: events 1-2 | | 172 | child =3D malloc(sizeof(*child)); | | ^~~~~~~~~~~~~~~~~~~~~~ | | | | | (1) this call could return NULL |...... | 175 | child->len =3D root->len - i - 1; | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (2) =E2=80=98child=E2=80=99 could b= e NULL: unchecked value from (1) | The default is -fanalyzer-verbosity=3D2. It seems some tweaking is needed.=