public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/106299] New: RFE: analyzer handling of fdopen
@ 2022-07-14 14:46 dmalcolm at gcc dot gnu.org
  2022-07-14 19:30 ` [Bug analyzer/106299] " egallager at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-07-14 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug analyzer/106299] RFE: analyzer handling of fdopen
  2022-07-14 14:46 [Bug analyzer/106299] New: RFE: analyzer handling of fdopen dmalcolm at gcc dot gnu.org
@ 2022-07-14 19:30 ` egallager at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: egallager at gcc dot gnu.org @ 2022-07-14 19:30 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=101550
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
As with other ideas for special-casing certain functions, I'd just be aware of
certain portability issues, as gnulib describes for fdopen here:
https://www.gnu.org/software/gnulib/manual/html_node/fdopen.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-14 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 14:46 [Bug analyzer/106299] New: RFE: analyzer handling of fdopen dmalcolm at gcc dot gnu.org
2022-07-14 19:30 ` [Bug analyzer/106299] " egallager at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).