From 2f2fa40ea78a06491871d2f270c9e2873e43732c Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sun, 15 Nov 2020 08:49:35 -0700 Subject: [PATCH] Get the right patch this time. Disable pointer-comparison warning for StackLowerThanAddress --- gtest-gcc11.patch | 15 +++++++++++++++ gtest.spec | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 gtest-gcc11.patch diff --git a/gtest-gcc11.patch b/gtest-gcc11.patch new file mode 100644 index 0000000..a772e26 --- /dev/null +++ b/gtest-gcc11.patch @@ -0,0 +1,15 @@ +diff --git a/googletest/src/gtest-death-test.cc b/googletest/src/gtest-death-test.cc +index da09a1c..4d6343f 100644 +--- a/googletest/src/gtest-death-test.cc ++++ b/googletest/src/gtest-death-test.cc +@@ -1289,7 +1289,10 @@ static void StackLowerThanAddress(const void* ptr, + GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ + static void StackLowerThanAddress(const void* ptr, bool* result) { + int dummy; ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wpointer-compare=" + *result = (&dummy < ptr); ++#pragma GCC diagnostic push + } + + // Make sure AddressSanitizer does not tamper with the stack here. diff --git a/gtest.spec b/gtest.spec index 70234f6..51328ba 100644 --- a/gtest.spec +++ b/gtest.spec @@ -112,7 +112,7 @@ sed -e "s/set(GOOGLETEST_VERSION .*)/set(GOOGLETEST_VERSION %{version})/" -i CMa %changelog * Sun Nov 15 2020 Jeff Law - 1.10.0-4 -- Fix argument type for StackLowerThanAddress to silence fatal gcc-11 diagnostic +- Disable pointer-comparison warning in StackLowerThanAddress * Tue Jul 28 2020 Fedora Release Engineering - 1.10.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild