public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/108830] New: Excess warnings from -Wanalyzer-null-dereference
@ 2023-02-17  0:10 dmalcolm at gcc dot gnu.org
  2023-02-21 22:05 ` [Bug analyzer/108830] " cvs-commit at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2023-02-17  0:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108830
           Summary: Excess warnings from -Wanalyzer-null-dereference
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
            Blocks: 108562
  Target Milestone: ---

Created attachment 54477
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54477&action=edit
Reproducer

I see lots of (probable) false positives from the attached on GCC 11 through
13.

Trunk:    https://godbolt.org/z/nzYreY1zx
GCC 12.2: https://godbolt.org/z/zjod5768f
GCC 11.3: https://godbolt.org/z/aeevhssG4

After the initial warning:
  <source>:77:24: warning: dereference of NULL 'new_vals' [CWE-476]
[-Wanalyzer-null-dereference]

...we emit 4 further almost identical warnings.

I think they're all false positives, due to invariants we can't know about, but
presumably we should only emit the first warning: once we've determined that
we're derefing NULL 'new_vals', it doesn't make sense to repeatedly complain
each time through the loop (which is what I think is happening).

There are also a huge number of spammy "'new_vals' is NULL" messages.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108562
[Bug 108562] [meta-bug] tracker bug for issues with -Wanalyzer-null-dereference

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-22 18:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17  0:10 [Bug analyzer/108830] New: Excess warnings from -Wanalyzer-null-dereference dmalcolm at gcc dot gnu.org
2023-02-21 22:05 ` [Bug analyzer/108830] " cvs-commit at gcc dot gnu.org
2023-02-21 22:30 ` dmalcolm at gcc dot gnu.org
2023-02-22 18:44 ` dmalcolm at gcc dot gnu.org

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).