fixed false positive file leaking on C/C++ for debian #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ae3f/aclspv!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "watta0/aclspv:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change refactors the SPIR-V output file handling code by replacing
C-style FILE* (fopen/fwrite/fclose) with std::ofstream.
The original change was motivated by a suspected file descriptor leak on
Debian. However, further investigation showed that this was a false positive,
and the existing implementation was already correctly closing the file.
Despite that, RAII-based resource management has been introduced via
std::ofstream to eliminate any potential for such false positives and to
ensure automatic and exception-safe file handling.
Key changes:
Replaced fopen/fwrite/fclose with std::ofstream
Added explicit is_open() check before writing
Kept existing control flow (including fallback label) unchanged
There is no intended functional change.
Quite many indentations has been changed but ignorable.
Refactoured code looks solid as explicit.
I approve.