From 05272b8e8eac87de4a75c0510235a99ce07b5b63 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Sun, 15 Oct 2017 00:51:09 +0900 Subject: [PATCH] refactor: use dummy function call instead of using #pragma --- fmt/format.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/fmt/format.cc b/fmt/format.cc index 4c14d0c6..ff960eae 100644 --- a/fmt/format.cc +++ b/fmt/format.cc @@ -70,11 +70,6 @@ # 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 *, ...) { @@ -84,10 +79,6 @@ 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 {} @@ -189,8 +180,9 @@ int safe_strerror( : error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {} int run() { - // Suppress a warning about unused strerror_r. + // Suppress a warning about unused strerror_r and strerror_s. strerror_r(0, FMT_NULL, ""); + strerror_s(FMT_NULL, 0, ""); return handle(strerror_r(error_code_, buffer_, buffer_size_)); } };