[Bug analyzer/114791] analyzer: file-leak not detected

2024-04-21 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791 --- Comment #5 from Urs Janßen --- -Wanalyzer-fd-leak has the same issue, no warning given for: #define _DEFAULT_SOURCE 1 #include #include #include #include #include int main(void); int main(void) { int fd = -1; int i = 0;

[Bug analyzer/114791] analyzer: file-leak not detected

2024-04-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791 --- Comment #4 from Andrew Pinski --- Interesting, with -O0, there is a warning but that can be turned into a false positive if you enable the "missing:" section.

[Bug analyzer/114791] analyzer: file-leak not detected

2024-04-20 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791 --- Comment #3 from Urs Janßen --- Comment on attachment 57998 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57998 minimal test case >#include >#include >#include >#include > >int main(void); > >int main(void) { >FILE *fp =

[Bug analyzer/114791] analyzer: file-leak not detected

2024-04-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791 Andrew Pinski changed: What|Removed |Added Keywords||diagnostic Last reconfirmed|

[Bug analyzer/114791] analyzer: file-leak not detected

2024-04-20 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791 --- Comment #1 from Urs Janßen --- Created attachment 57999 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57999=edit preprocessed example