From 3eff21366e541ae378dcca15baf0e060a53a0184 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Fri, 3 Mar 2023 16:53:08 +0100 Subject: [PATCH] Fix MinGW build error (#4935) (#5127) This commit fixes the following build error when the source code is build with MinGW gcc 12 and compiler switch '-Werror=maybe-uninitialized' is added: 'file.{anonymous}::OutputFile::old_mode_' may be used uninitialized in this function [-Werror=maybe-uninitialized] --- tools/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/io.h b/tools/io.h index 9dc834edf..8bbee3a0d 100644 --- a/tools/io.h +++ b/tools/io.h @@ -127,7 +127,7 @@ class OutputFile { public: // Opens |filename| in the given mode. If |filename| is nullptr, the empty // string or "-", stdout will be set to the given mode. - OutputFile(const char* filename, const char* mode) { + OutputFile(const char* filename, const char* mode) : old_mode_(0) { const bool use_stdout = !filename || (filename[0] == '-' && filename[1] == '\0'); if (use_stdout) {