From 9feb5fbaf0ba1f255f3b4269729a630ea1973431 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 5 Dec 2014 21:44:30 +0200 Subject: [PATCH] disable Wshadow in gcc --- include/spdlog/details/format.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/spdlog/details/format.h b/include/spdlog/details/format.h index a9b51c21..82f65058 100644 --- a/include/spdlog/details/format.h +++ b/include/spdlog/details/format.h @@ -45,13 +45,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endif #ifdef __GNUC__ +// Ignore shadow warnings +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wshadow" + # define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) # define FMT_GCC_EXTENSION __extension__ // Disable warning about "long long" which is sometimes reported even // when using __extension__. # if FMT_GCC_VERSION >= 406 # pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wshadow" # pragma GCC diagnostic ignored "-Wlong-long" # endif #else @@ -2861,8 +2864,12 @@ FMT_VARIADIC(int, fprintf, std::FILE *, StringRef) # pragma GCC diagnostic pop #endif + #define FMT_HEADER_ONLY # include "format.cc" +#ifdef __GNUC__ +# pragma GCC diagnostic pop //pop -Wshadow warnings ignore +#endif #endif // FMT_FORMAT_H_