From ab9115e0a06e93fa12fa2cd3708fed011eda8905 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 10 Mar 2020 02:41:37 +0100 Subject: [PATCH] Use correct warning option for older gcc in wxLog test -Wdangling-else is only available since gcc 7. --- tests/log/logtest.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/log/logtest.cpp b/tests/log/logtest.cpp index 95f2d48def..7a39c1331c 100644 --- a/tests/log/logtest.cpp +++ b/tests/log/logtest.cpp @@ -398,7 +398,13 @@ void LogTestCase::NoWarnings() // any test, and their purpose is merely to guarantee that the wx(V)LogXXX // macros compile without 'dangling else' warnings. #if defined(__clang__) || wxCHECK_GCC_VERSION(4, 6) - #pragma GCC diagnostic error "-Wdangling-else" + // gcc 7 split -Wdangling-else from the much older -Wparentheses, so use + // the new warning if it's available or the old one otherwise. + #if wxCHECK_GCC_VERSION(7, 0) + #pragma GCC diagnostic error "-Wdangling-else" + #else + #pragma GCC diagnostic error "-Wparentheses" + #endif #endif static void v(int x, ...)