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

            Bug ID: 106283
           Summary: RFE: analyzer handling of close_range and closefrom
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
            Blocks: 106003
  Target Milestone: ---

As noted here:
  https://sourceware.org/pipermail/libc-alpha/2022-July/140623.html
and
  https://sourceware.org/pipermail/libc-alpha/2022-July/140624.html
other ways of closing a file-descriptor other than calling "close" are:

close_range:
  https://man7.org/linux/man-pages//man2/close_range.2.html

closefrom:
  https://man.openbsd.org/closefrom

To e.g. avoid false reports from -Wanalyzer-fd-leak we might as well add
special-case handling for these functions in sm-fd.cc

(consider cases where each endpoint is concrete vs symbolic, and where specific
FDs of interest are concrete vs symbolic)

Probably a low-priority RFE.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106003
[Bug 106003] RFE: -fanalyzer could complain about misuse of file-descriptors

Reply via email to