Workaround gcc _Pragma bug 59884

This commit is contained in:
Victor Zverovich 2021-10-02 13:35:12 -07:00
parent d6590e3bd2
commit 012cc709d0
2 changed files with 12 additions and 5 deletions

View File

@ -26,10 +26,17 @@
#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
# define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
# define FMT_GCC_PRAGMA(arg) _Pragma(arg)
#else
# define FMT_GCC_VERSION 0
# define FMT_GCC_PRAGMA(arg)
#endif
#ifndef FMT_GCC_PRAGMA
// Workaround _Pragma bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59884.
# if FMT_GCC_VERSION >= 504
# define FMT_GCC_PRAGMA(arg) _Pragma(arg)
# else
# define FMT_GCC_PRAGMA(arg)
# endif
#endif
#ifdef __ICL

View File

@ -188,8 +188,8 @@ template <typename T = void> struct basic_impl_data {
};
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
FMT_GCC_PRAGMA("GCC diagnostic push")
FMT_GCC_PRAGMA("GCC diagnostic ignored \"-Wnarrowing\"")
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wnarrowing"
#endif
// Binary exponents of pow(10, k), for k = -348, -340, ..., 340, corresponding
// to significands above.
@ -203,7 +203,7 @@ template <typename T = void> struct basic_impl_data {
534, 561, 588, 614, 641, 667, 694, 720, 747, 774, 800,
827, 853, 880, 907, 933, 960, 986, 1013, 1039, 1066};
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
FMT_GCC_PRAGMA("GCC diagnostic pop")
# pragma GCC diagnostic pop
#endif
static constexpr uint64_t power_of_10_64[20] = {