diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dc4e469..d95b0c60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif () if (MSVC) - set(PEDANTIC_COMPILE_FLAGS /W4) + set(PEDANTIC_COMPILE_FLAGS /W3) set(WERROR_FLAG /WX) endif () diff --git a/include/fmt/core.h b/include/fmt/core.h index 3cd6b4c0..cf87bce8 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -104,7 +104,7 @@ #if FMT_HAS_CPP_ATTRIBUTE(noreturn) # define FMT_NORETURN [[noreturn]] #else -# define FMT_NORETURN /*noreturn*/ +# define FMT_NORETURN #endif // Check if exceptions are disabled. diff --git a/include/fmt/format.h b/include/fmt/format.h index 0851a913..3d6ee245 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -146,7 +146,8 @@ FMT_END_NAMESPACE # define FMT_USE_TRAILING_RETURN 0 #endif -#if FMT_HAS_GXX_CXX11 || FMT_HAS_FEATURE(cxx_rvalue_references) || FMT_MSC_VER >= 1600 +#if FMT_HAS_GXX_CXX11 || FMT_HAS_FEATURE(cxx_rvalue_references) || \ + FMT_MSC_VER >= 1600 # define FMT_USE_RVALUE_REFERENCES 1 #else # define FMT_USE_RVALUE_REFERENCES 0 @@ -283,18 +284,21 @@ class fp { typedef uint64_t significand_type; // All sizes are in bits. - static FMT_CONSTEXPR_DECL const int char_size = std::numeric_limits::digits; + static FMT_CONSTEXPR_DECL const int char_size = + std::numeric_limits::digits; // Subtract 1 to account for an implicit most significant bit in the // normalized form. static FMT_CONSTEXPR_DECL const int double_significand_size = std::numeric_limits::digits - 1; - static FMT_CONSTEXPR_DECL const uint64_t implicit_bit = 1ull << double_significand_size; + static FMT_CONSTEXPR_DECL const uint64_t implicit_bit = + 1ull << double_significand_size; public: significand_type f; int e; - static FMT_CONSTEXPR_DECL const int significand_size = sizeof(significand_type) * char_size; + static FMT_CONSTEXPR_DECL const int significand_size = + sizeof(significand_type) * char_size; fp(uint64_t f, int e): f(f), e(e) {} @@ -1670,13 +1674,6 @@ FMT_CONSTEXPR unsigned parse_nonnegative_int(Iterator &it, ErrorHandler &&eh) { return value; } -#if FMT_MSC_VER -// Warns that the compiler cannot generate an assignment operator -// The class has a reference member variable, so this is obviously the case -# pragma warning(push) -# pragma warning(disable: 4512) -#endif - template class custom_formatter: public function { private: @@ -1694,10 +1691,6 @@ class custom_formatter: public function { bool operator()(T) const { return false; } }; -#if FMT_MSC_VER -# pragma warning(pop) -#endif - template struct is_integer { enum { diff --git a/include/fmt/printf.h b/include/fmt/printf.h index ea383783..5a44a834 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -49,10 +49,9 @@ class printf_precision_handler: public function { } template - typename std::enable_if::value, int>::type - operator()(T) { + typename std::enable_if::value, int>::type operator()(T) { FMT_THROW(format_error("precision is not integer")); - return 0; // Silence visual studio + return 0; } }; @@ -194,7 +193,7 @@ class printf_width_handler: public function { typename std::enable_if::value, unsigned>::type operator()(T) { FMT_THROW(format_error("width is not integer")); - return 0; // Silence Visual Studio + return 0; } }; } // namespace internal @@ -635,13 +634,8 @@ inline int fprintf(std::FILE *f, string_view format_str, const Args & ... args) template inline int fprintf(std::FILE *f, wstring_view format_str, const Args & ... args) { -#if FMT_GCC_VERSION && FMT_GCC_VERSION <= 440 - return vfprintf(f, format_str, - make_format_args::type>(args...)); -#else return vfprintf(f, format_str, make_format_args::type>(args...)); -#endif } inline int vprintf(string_view format, printf_args args) {