[Bug analyzer/110520] New: -Wanalyzer-null-dereference false nagetive with `*ptr = 10086`

dale.mengli.ming at proton dot me gcc-bugzilla@gcc.gnu.org
Sun Jul 2 12:30:34 GMT 2023


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

            Bug ID: 110520
           Summary: -Wanalyzer-null-dereference false nagetive with `*ptr
                    = 10086`
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dale.mengli.ming at proton dot me
  Target Milestone: ---

Hi,in this case (https://godbolt.org/z/4Md3o94Gx), the `ptr` is a null pointer,
but the analyzer doesn't report an NPD with it. When `__builtin_strlen(buf) ==
0` (https://godbolt.org/z/fnbMY9W5z), the analyzer reports that.


More information about the Gcc-bugs mailing list