From: kgv Date: Tue, 3 Jul 2018 11:31:40 +0000 (+0300) Subject: 0029909: Coding - GCC compiler warnings in Qt headers while building Samples in OCCT... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=09b5f03547c5028febf48b10046481f76b217205;p=occt-copy.git 0029909: Coding - GCC compiler warnings in Qt headers while building Samples in OCCT and Products on Debian80 64 bit Standard_WarningsDisable.hxx has been extended by ignoring -Wunused-local-typedefs within GCC compiler. --- diff --git a/src/Standard/Standard_WarningsDisable.hxx b/src/Standard/Standard_WarningsDisable.hxx index 199d746ca4..f3e043d21b 100644 --- a/src/Standard/Standard_WarningsDisable.hxx +++ b/src/Standard/Standard_WarningsDisable.hxx @@ -24,7 +24,20 @@ //! #include // some header that can generate warnings //! #include -#ifdef _MSC_VER -#pragma warning(push, 0) +#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wall" + #pragma clang diagnostic ignored "-Wextra" +#elif defined(_MSC_VER) + #pragma warning(push, 0) +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + // -Wall does not work here for GCC, so the only way is to list all most important warnings... + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #pragma GCC diagnostic ignored "-Wunused-variable" + #pragma GCC diagnostic ignored "-Wunused-parameter" + #pragma GCC diagnostic ignored "-Wenum-compare" + #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) + #pragma GCC diagnostic ignored "-Wunused-local-typedefs" + #endif #endif - diff --git a/src/Standard/Standard_WarningsRestore.hxx b/src/Standard/Standard_WarningsRestore.hxx index f03cc66429..5af045ae67 100644 --- a/src/Standard/Standard_WarningsRestore.hxx +++ b/src/Standard/Standard_WarningsRestore.hxx @@ -24,7 +24,11 @@ //! #include // some header that can generate warnings //! #include -#ifdef _MSC_VER -#pragma warning(pop) +#if defined(__clang__) + #pragma clang diagnostic pop +#elif defined(_MSC_VER) + #pragma warning(pop) +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + #pragma GCC diagnostic pop #endif