[Bug analyzer/99028] diagnostic path is too verbose

dmalcolm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 9 17:19:15 GMT 2021


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.


More information about the Gcc-bugs mailing list