From 7fb039b0663ebd81e4521fb1ee43bf29dc890002 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Thu, 28 Apr 2022 17:51:42 -0700 Subject: [PATCH] SerialIOTest: Fix GCC Pragma Check There was a typo in `__GNUC_MINOR__`, causing the test not to work on all GCC versions. Follow-up to #1213 --- test/SerialIOTest.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/SerialIOTest.cpp b/test/SerialIOTest.cpp index 5cf48f8eb8..92de22aa43 100644 --- a/test/SerialIOTest.cpp +++ b/test/SerialIOTest.cpp @@ -417,9 +417,11 @@ TEST_CASE("multiple_series_handles_test", "[serial]") /* * clang also understands these pragmas. */ -#if defined(__GNUC__MINOR__) || defined(__clang__) +#if defined(__GNUC_MINOR__) && !defined(__INTEL_COMPILER) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined(__clang__) +#pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif /* * First test: No premature flushes through destructor when another copy @@ -463,11 +465,10 @@ TEST_CASE("multiple_series_handles_test", "[serial]") */ series_ptr->flush(); } -#if defined(__INTEL_COMPILER) -#pragma warning(disable : 2282) -#endif -#if defined(__GNUC__MINOR__) || defined(__clang__) +#if defined(__GNUC_MINOR__) && !defined(__INTEL_COMPILER) #pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop #endif }