public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-99028-4-9iFy7xQRxG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99028-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99028

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
At -fanalyzer-verbosity=1 and below, we only show those two events:

In function ‘add_to_trie’:
../../src/gcc/testsuite/gcc.dg/analyzer/pr99028.c:175:28: warning: dereference
of possibly-NULL ‘child’ [CWE-690] [-Wanalyzer-possible-null-dereference]
  175 |                 child->len = root->len - i - 1;
      |                 ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
  ‘add_to_trie’: events 1-2
    |
    |  172 |                 child = malloc(sizeof(*child));
    |      |                         ^~~~~~~~~~~~~~~~~~~~~~
    |      |                         |
    |      |                         (1) this call could return NULL
    |......
    |  175 |                 child->len = root->len - i - 1;
    |      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |      |                            |
    |      |                            (2) ‘child’ could be NULL: unchecked
value from (1)
    |

The default is -fanalyzer-verbosity=2.

It seems some tweaking is needed.

      parent reply	other threads:[~2021-02-09 17:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 16:01 [Bug analyzer/99028] New: " antonio.chirizzi at gmail dot com
2021-02-09 16:39 ` [Bug analyzer/99028] " dmalcolm at gcc dot gnu.org
2021-02-09 17:19 ` dmalcolm at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99028-4-9iFy7xQRxG@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).