From 20b50e4cc1fce311f47e0d065d61f10ba868376e Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Tue, 4 Jan 2022 01:09:24 +0800 Subject: [PATCH] Fix linux build - warning: 'dummy' may be used uninitialized - error: 'runtime_error' is not a member of 'std' --- engine/fsposix/FileSystemPosix.cpp | 1 + external/gtest/src/gtest-death-test.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/fsposix/FileSystemPosix.cpp b/engine/fsposix/FileSystemPosix.cpp index e191ff01..c3f47147 100644 --- a/engine/fsposix/FileSystemPosix.cpp +++ b/engine/fsposix/FileSystemPosix.cpp @@ -6,6 +6,7 @@ #include #include #include +#include using namespace FS; using namespace FS::detail; diff --git a/external/gtest/src/gtest-death-test.cc b/external/gtest/src/gtest-death-test.cc index a01a3698..a7164c8c 100644 --- a/external/gtest/src/gtest-death-test.cc +++ b/external/gtest/src/gtest-death-test.cc @@ -997,14 +997,14 @@ static int ExecDeathTestChildMain(void* child_arg) { // correct answer. void StackLowerThanAddress(const void* ptr, bool* result) GTEST_NO_INLINE_; void StackLowerThanAddress(const void* ptr, bool* result) { - int dummy; + int dummy = 0; *result = (&dummy < ptr); } // Make sure AddressSanitizer does not tamper with the stack here. GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ bool StackGrowsDown() { - int dummy; + int dummy = 0; bool result; StackLowerThanAddress(&dummy, &result); return result;