diff --git a/fmt/format.cc b/fmt/format.cc index 4b7c2d24..4c14d0c6 100644 --- a/fmt/format.cc +++ b/fmt/format.cc @@ -70,6 +70,11 @@ # pragma warning(disable: 4996) #endif +#ifdef __c2__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-function" +#endif + // Dummy implementations of strerror_r and strerror_s called if corresponding // system functions are not available. static inline fmt::internal::Null<> strerror_r(int, char *, ...) { @@ -79,6 +84,10 @@ static inline fmt::internal::Null<> strerror_s(char *, std::size_t, ...) { return fmt::internal::Null<>(); } +#ifdef __c2__ +# pragma clang diagnostic pop +#endif + namespace fmt { FMT_FUNC internal::RuntimeError::~RuntimeError() FMT_DTOR_NOEXCEPT {} @@ -159,6 +168,11 @@ int safe_strerror( ERANGE : result; } +#ifdef __c2__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + // Fallback to strerror if strerror_r and strerror_s are not available. int fallback(internal::Null<>) { errno = 0; @@ -166,6 +180,10 @@ int safe_strerror( return errno; } +#ifdef __c2__ +# pragma clang diagnostic pop +#endif + public: StrError(int err_code, char *&buf, std::size_t buf_size) : error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {} diff --git a/fmt/format.h b/fmt/format.h index c02a301e..c91bbf60 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -335,7 +335,10 @@ typedef __int64 intmax_t; namespace fmt { namespace internal { -# pragma intrinsic(_BitScanReverse) +// avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning +# ifndef __clang__ +# pragma intrinsic(_BitScanReverse) +# endif inline uint32_t clz(uint32_t x) { unsigned long r = 0; _BitScanReverse(&r, x); @@ -349,7 +352,8 @@ inline uint32_t clz(uint32_t x) { } # define FMT_BUILTIN_CLZ(n) fmt::internal::clz(n) -# ifdef _WIN64 +// avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning +# if defined(_WIN64) && !defined(__clang__) # pragma intrinsic(_BitScanReverse64) # endif