public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "buczek at molgen dot mpg.de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/109839] -Wanalyzer-fd-leak false positive with routine dup2 Date: Thu, 11 Jan 2024 08:18:48 +0000 [thread overview] Message-ID: <bug-109839-4-po6Z5D8gos@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-109839-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109839 Donald Buczek <buczek at molgen dot mpg.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |buczek at molgen dot mpg.de --- Comment #1 from Donald Buczek <buczek at molgen dot mpg.de> --- Correct, dup2() does not allocate a new file descriptor, so the returned file descriptor can't be leaked. Reduced test case: #include <unistd.h> void f(int old, int new) { int r = dup2(old, new); } https://gcc.godbolt.org/z/6sP9v1r5a
prev parent reply other threads:[~2024-01-11 8:18 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-05-13 2:17 [Bug analyzer/109839] New: " eggert at cs dot ucla.edu 2024-01-11 8:18 ` buczek at molgen dot mpg.de [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-109839-4-po6Z5D8gos@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).