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

            Bug ID: 111144
           Summary: RFE: could -fanalyzer warn about assertions that have
                    side effects?
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

>From IRC:

<sam_> dmalcolm__: I wonder if there's any way that the analyzer could find
suspicious asserts (asserts w/ side effects)

We already have -Wanalyzer-tainted-assertion (as of gcc 13), which has some
logic for identifying assertion-failure routines, and control flow leading to
them, though the latter part is specific to taint-handling.

Presumably we'd need to identify:
(a) code that's executed as part of the conditional of an assertion
(b) code that has a "side effect".

Reply via email to