Commit 6cb68f94 authored by Victor Zverovich's avatar Victor Zverovich

Fix warnings

parent 0b635c9d
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
// Dummy implementations of strerror_r and strerror_s called if corresponding // Dummy implementations of strerror_r and strerror_s called if corresponding
// system functions are not available. // system functions are not available.
static inline fmt::internal::null<> strerror_r(int, char *, ...) { inline fmt::internal::null<> strerror_r(int, char *, ...) {
return fmt::internal::null<>(); return fmt::internal::null<>();
} }
static inline fmt::internal::null<> strerror_s(char *, std::size_t, ...) { inline fmt::internal::null<> strerror_s(char *, std::size_t, ...) {
return fmt::internal::null<>(); return fmt::internal::null<>();
} }
...@@ -157,8 +157,6 @@ int safe_strerror( ...@@ -157,8 +157,6 @@ int safe_strerror(
: error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {} : error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {}
int run() { int run() {
// Suppress a warning about unused strerror_r.
strerror_r(0, FMT_NULL, "");
return handle(strerror_r(error_code_, buffer_, buffer_size_)); return handle(strerror_r(error_code_, buffer_, buffer_size_));
} }
}; };
......
...@@ -160,7 +160,10 @@ ...@@ -160,7 +160,10 @@
namespace fmt { namespace fmt {
namespace internal { namespace internal {
// Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning.
# ifndef __clang__
# pragma intrinsic(_BitScanReverse) # pragma intrinsic(_BitScanReverse)
# endif
inline uint32_t clz(uint32_t x) { inline uint32_t clz(uint32_t x) {
unsigned long r = 0; unsigned long r = 0;
_BitScanReverse(&r, x); _BitScanReverse(&r, x);
...@@ -174,7 +177,7 @@ inline uint32_t clz(uint32_t x) { ...@@ -174,7 +177,7 @@ inline uint32_t clz(uint32_t x) {
} }
# define FMT_BUILTIN_CLZ(n) fmt::internal::clz(n) # define FMT_BUILTIN_CLZ(n) fmt::internal::clz(n)
# ifdef _WIN64 # if defined(_WIN64) && !defined(__clang__)
# pragma intrinsic(_BitScanReverse64) # pragma intrinsic(_BitScanReverse64)
# endif # endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment