Skip to content

Commit

Permalink
Codefix: silence [maybe-]uninitialized warnings for FileHandle class
Browse files Browse the repository at this point in the history
  • Loading branch information
glx22 committed Dec 27, 2024
1 parent 4494d03 commit cd27273
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/fileio_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ enum Searchpath : unsigned {

DECLARE_POSTFIX_INCREMENT(Searchpath)

IGNORE_UNINITIALIZED_WARNING_START
class FileHandle {
public:
static std::optional<FileHandle> Open(const std::string &filename, const std::string &mode);
Expand All @@ -180,6 +181,7 @@ class FileHandle {

FileHandle(FILE *f) : f(f) { assert(this->f != nullptr); }
};
IGNORE_UNINITIALIZED_WARNING_STOP

/* Ensure has_value() is used consistently. */
template <> constexpr std::optional<FileHandle>::operator bool() const noexcept = delete;
Expand Down

0 comments on commit cd27273

Please sign in to comment.