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

            Bug ID: 122623
           Summary: Possible regression in analyzer signal:noise when
                    compiling C code with -fexceptions.
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

See e.g.
https://lists.fedoraproject.org/archives/list/[email protected]/message/M7LUZCTVWD3WOIVKRS3KQK6B2PFGVRP3/

When -fexceptions is enabled, gcc 16 -fanalyzer considers that any function
that isn't explicitly marked as "nothrow" could throw, and considers that as a
possible execution path through the code.

It turns out that Fedora's build flags use -fexceptions by default, even for C
code.

I'm worried that this could lead to a big jump in results for C code for GCC 16
-fanalyzer, and that most/all of these are effectively false positives, as the
analyzer doesn't have good heuristics for rejecting functions as being
"nothrow" that weren't explicitly marked as such (but probably are, in C code
that doesn't call outside C code).

Filing this bug for myself, to investigate this, and possibly put in some kind
of C-specific mitigation if it's leading to lots of new false positives.

Reply via email to