[Bug analyzer/106298] RFE: analyzer handling of dup, dup2, and dup3

2022-08-02 Thread mir at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106298

Immad Mir  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Immad Mir  ---
Analyzer can now recognize these functions. See the commit above.

[Bug analyzer/106298] RFE: analyzer handling of dup, dup2, and dup3

2022-08-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106298

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Immad Mir :

https://gcc.gnu.org/g:6a11f2d974a912aaaedb0ce32cdfde10193003cd

commit r13-1936-g6a11f2d974a912aaaedb0ce32cdfde10193003cd
Author: Immad Mir 
Date:   Tue Aug 2 22:22:07 2022 +0530

analyzer: support for creat, dup, dup2 and dup3 [PR106298]

This patch extends the state machine in sm-fd.cc to support
creat, dup, dup2 and dup3 functions.

Lightly tested on x86_64 Linux.

gcc/analyzer/ChangeLog:
PR analyzer/106298
* sm-fd.cc (fd_state_machine::on_open): Add
creat, dup, dup2 and dup3 functions.
(enum dup): New.
(fd_state_machine::valid_to_unchecked_state): New.
(fd_state_machine::on_creat): New.
(fd_state_machine::on_dup): New.

gcc/testsuite/ChangeLog:
PR analyzer/106298
* gcc.dg/analyzer/fd-1.c: Add tests for 'creat'.
* gcc.dg/analyzer/fd-2.c: Likewise.
* gcc.dg/analyzer/fd-4.c: Likewise.
* gcc.dg/analyzer/fd-dup-1.c: New tests.

Signed-off-by: Immad Mir 

[Bug analyzer/106298] RFE: analyzer handling of dup, dup2, and dup3

2022-07-27 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106298

David Malcolm  changed:

   What|Removed |Added

   Last reconfirmed||2022-07-27
   Assignee|dmalcolm at gcc dot gnu.org|mir at gcc dot gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #2 from David Malcolm  ---
Immad's looking at this one.

[Bug analyzer/106298] RFE: analyzer handling of dup, dup2, and dup3

2022-07-14 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106298

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #1 from Eric Gallager  ---
Portability issues to be aware of with dup and dup2, per gnulib:
https://www.gnu.org/software/gnulib/manual/html_node/dup.html
https://www.gnu.org/software/gnulib/manual/html_node/dup2.html