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