From fa545023ada3f2a5f79cab1ff628fd18434c7c2e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 23 Mar 2013 21:55:27 +0100 Subject: Introduce HAVE_GCC_PRAGMA_DIAGNOSTIC_{MODIFY,SCOPE} ...replacing hard-coded GCC version checks. Those checks that guard #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" appear relevant only for GCC itself, not Clang (which used to fail the old guards because it typically announces itself with a rather low __GNUC__/__GNUC_MINOR__ version), see 6e67c03dc0225fc66343546b14e902b9d238b1a3 "Enable -Wnon-virtual-dtor for GCC 4.6" Change-Id: I6bfa4d5caa6192e7a203ce829682bf6bb8d61a1b --- connectivity/source/drivers/mozab/post_include_mozilla.h | 3 ++- connectivity/source/drivers/mozab/pre_include_mozilla.h | 5 ++++- connectivity/source/parse/sqlflex.l | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/mozab/post_include_mozilla.h b/connectivity/source/drivers/mozab/post_include_mozilla.h index 9534b03680a6..20753f4a0e5b 100644 --- a/connectivity/source/drivers/mozab/post_include_mozilla.h +++ b/connectivity/source/drivers/mozab/post_include_mozilla.h @@ -17,7 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#if defined __GNUC__ && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE \ + && !defined __clang__ #pragma GCC diagnostic pop #elif defined __SUNPRO_CC #pragma enable_warn diff --git a/connectivity/source/drivers/mozab/pre_include_mozilla.h b/connectivity/source/drivers/mozab/pre_include_mozilla.h index b59974e6010a..14a7ad6c8038 100644 --- a/connectivity/source/drivers/mozab/pre_include_mozilla.h +++ b/connectivity/source/drivers/mozab/pre_include_mozilla.h @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + #ifndef MINIMAL_PROFILEDISCOVER // Turn off DEBUG Assertions #ifdef _DEBUG @@ -46,7 +48,8 @@ #endif #endif -#if defined __GNUC__ && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE \ + && !defined __clang__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #elif defined __SUNPRO_CC diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l index d17128ec64a9..44484fe760ed 100644 --- a/connectivity/source/parse/sqlflex.l +++ b/connectivity/source/parse/sqlflex.l @@ -18,6 +18,8 @@ // the License at http://www.apache.org/licenses/LICENSE-2.0 . // +#include "sal/config.h" + #define YY_EXIT 1 // YY_FATAL will not halt the application #ifndef _CSTDARG_ @@ -44,11 +46,9 @@ #include #include -#if defined __GNUC__ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY # pragma GCC diagnostic ignored "-Wwrite-strings" # pragma GCC diagnostic ignored "-Wunused-function" -#endif #elif defined __SUNPRO_CC #pragma disable_warn #elif defined _MSC_VER -- cgit