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

            Bug ID: 106298
           Summary: RFE: analyzer handling of dup, dup2, and dup3
           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: ---

Now that -fanalyzer has warnings for file descriptors (especially leaks), we
should probably special-case the following functions (rather than attempt to
express them via attributes):

 int dup(int oldfd);
 int dup2(int oldfd, int newfd);
 int dup3(int oldfd, int newfd, int flags);

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


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