From dc8f04a5c90d7163dde640d7033224574434ec09 Mon Sep 17 00:00:00 2001 From: virgiliofornazin Date: Sat, 4 Nov 2017 23:11:18 -0200 Subject: [PATCH] Removed warnings on MSVC 2017 Silence warnings of constant if expression in Microsoft Visual C++ compiler used in Visual Studio 2017 --- fmt/printf.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fmt/printf.h b/fmt/printf.h index db91022c..ba0a5d42 100644 --- a/fmt/printf.h +++ b/fmt/printf.h @@ -125,7 +125,14 @@ class ArgConverter : public ArgVisitor, void> { using internal::Arg; typedef typename internal::Conditional< is_same::value, U, T>::type TargetType; +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable: 4127) +#endif if (sizeof(TargetType) <= sizeof(int)) { +#if defined(_MSC_VER) +#pragma warning(pop) +#endif // Extra casts are used to silence warnings. if (is_signed) { arg_.type = Arg::INT;