From f911a88150ee5925cd49f141d64aa1c68ae97ffa Mon Sep 17 00:00:00 2001 From: Alexey Morozov Date: Mon, 13 Oct 2014 13:43:18 +0700 Subject: [PATCH] Fix test for GCC Issue only warning even if compilation flags treat warnings as errors --- gmock/gtest/gtest.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gmock/gtest/gtest.h b/gmock/gtest/gtest.h index 4f3804f7..20527616 100644 --- a/gmock/gtest/gtest.h +++ b/gmock/gtest/gtest.h @@ -18856,6 +18856,9 @@ AssertionResult CmpHelperEQ(const char* expected_expression, # pragma warning(push) // Saves the current warning state. # pragma warning(disable:4389) // Temporarily disables warning on // signed/unsigned mismatch. +#elif __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic warning "-Wsign-compare" #endif if (expected == actual) { @@ -18864,6 +18867,8 @@ AssertionResult CmpHelperEQ(const char* expected_expression, #ifdef _MSC_VER # pragma warning(pop) // Restores the warning state. +#elif __GNUC__ +# pragma GCC diagnostic pop #endif return EqFailure(expected_expression,