https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106299
Bug ID: 106299 Summary: RFE: analyzer handling of fdopen 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 the analyzer supports checking both filedescriptor *and* FILE * usage, we should probably add special-case handling of fdopen: https://www.man7.org/linux/man-pages/man3/fdopen.3p.html I'm not quite sure how to model the interaction between the two state machines; perhaps a successful fdopen on a fd should transition the fd from an open state to the "stop" state (i.e. stop tracking state on this fd), and transition the FILE * from the start state to the open state. See also bug 101550, which has an example of using fdopen. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106003 [Bug 106003] RFE: -fanalyzer could complain about misuse of file-descriptors