From 47b38d8a6bcbb63bf0b9ad520198bb8eab2b8241 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 6 Aug 2020 21:11:00 -0400 Subject: Fix warning suppression macros in test programs --- TestPrograms/test_cxx11_noexcept.cxx | 6 ++++-- TestPrograms/test_ppc_power7.cxx | 6 ++++-- TestPrograms/test_ppc_power8.cxx | 6 ++++-- TestPrograms/test_ppc_power9.cxx | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) (limited to 'TestPrograms') diff --git a/TestPrograms/test_cxx11_noexcept.cxx b/TestPrograms/test_cxx11_noexcept.cxx index 5be9d597..a6c70b81 100644 --- a/TestPrograms/test_cxx11_noexcept.cxx +++ b/TestPrograms/test_cxx11_noexcept.cxx @@ -1,10 +1,12 @@ -#if defined(__GNUC_MAJOR__) -# define GNUC_VERSION (__GNUC__*1000 + __GNUC_MAJOR__*10) +#if defined(__GNUC__) +# define GNUC_VERSION (__GNUC__*1000 + __GNUC_MINOR__*10) #endif #if defined(__clang_major__) && defined(__apple_build_version__) +# undef GNUC_VERSION # define APPLE_VERSION (__clang_major__*1000 + __clang_minor__*10) #elif defined(__clang_major__) +# undef GNUC_VERSION # define LLVM_VERSION (__clang_major__*1000 + __clang_minor__*10) #endif diff --git a/TestPrograms/test_ppc_power7.cxx b/TestPrograms/test_ppc_power7.cxx index 22b791d6..3171a45e 100644 --- a/TestPrograms/test_ppc_power7.cxx +++ b/TestPrograms/test_ppc_power7.cxx @@ -1,10 +1,12 @@ -#if defined(__GNUC_MAJOR__) -# define GNUC_VERSION (__GNUC__*1000 + __GNUC_MAJOR__*10) +#if defined(__GNUC__) +# define GNUC_VERSION (__GNUC__*1000 + __GNUC_MINOR__*10) #endif #if defined(__clang_major__) && defined(__apple_build_version__) +# undef GNUC_VERSION # define APPLE_VERSION (__clang_major__*1000 + __clang_minor__*10) #elif defined(__clang_major__) +# undef GNUC_VERSION # define LLVM_VERSION (__clang_major__*1000 + __clang_minor__*10) #endif diff --git a/TestPrograms/test_ppc_power8.cxx b/TestPrograms/test_ppc_power8.cxx index 00a3309c..90950dd4 100644 --- a/TestPrograms/test_ppc_power8.cxx +++ b/TestPrograms/test_ppc_power8.cxx @@ -1,10 +1,12 @@ -#if defined(__GNUC_MAJOR__) -# define GNUC_VERSION (__GNUC__*1000 + __GNUC_MAJOR__*10) +#if defined(__GNUC__) +# define GNUC_VERSION (__GNUC__*1000 + __GNUC_MINOR__*10) #endif #if defined(__clang_major__) && defined(__apple_build_version__) +# undef GNUC_VERSION # define APPLE_VERSION (__clang_major__*1000 + __clang_minor__*10) #elif defined(__clang_major__) +# undef GNUC_VERSION # define LLVM_VERSION (__clang_major__*1000 + __clang_minor__*10) #endif diff --git a/TestPrograms/test_ppc_power9.cxx b/TestPrograms/test_ppc_power9.cxx index d7951f47..0b676fa6 100644 --- a/TestPrograms/test_ppc_power9.cxx +++ b/TestPrograms/test_ppc_power9.cxx @@ -1,10 +1,12 @@ -#if defined(__GNUC_MAJOR__) -# define GNUC_VERSION (__GNUC__*1000 + __GNUC_MAJOR__*10) +#if defined(__GNUC__) +# define GNUC_VERSION (__GNUC__*1000 + __GNUC_MINOR__*10) #endif #if defined(__clang_major__) && defined(__apple_build_version__) +# undef GNUC_VERSION # define APPLE_VERSION (__clang_major__*1000 + __clang_minor__*10) #elif defined(__clang_major__) +# undef GNUC_VERSION # define LLVM_VERSION (__clang_major__*1000 + __clang_minor__*10) #endif -- cgit v1.2.1