diff --git a/include/boost/static_string/static_string.hpp b/include/boost/static_string/static_string.hpp index 24f7699..a1dc125 100644 --- a/include/boost/static_string/static_string.hpp +++ b/include/boost/static_string/static_string.hpp @@ -474,6 +474,14 @@ count_digits(std::size_t value) return value < 10 ? 1 : count_digits(value / 10) + 1; } +// Ignore -Wformat-truncation, we know what +// we are doing here. The version check does +// not need to be extremely precise. +#if defined(__GNUC__) && __GNUC__ > 4 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-truncation" +#endif + template inline static_string @@ -608,6 +616,10 @@ to_static_wstring_float_impl(long double value) noexcept return static_wstring(buffer); } +#if defined(__GNUC__) && __GNUC__ > 4 +#pragma GCC diagnostic pop +#endif + template BOOST_STATIC_STRING_CPP14_CONSTEXPR inline