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

Simplify warning suppression

parent 12f46838
......@@ -247,8 +247,10 @@ template <> FMT_FUNC int count_digits<4>(internal::uintptr n) {
template <typename T>
int format_float(char* buf, std::size_t size, const char* format, int precision,
T value) {
return precision < 0 ? FMT_SNPRINTF(buf, size, format, value)
: FMT_SNPRINTF(buf, size, format, precision, value);
// Suppress the warning about nonliteral format string.
auto snprintf_ptr = FMT_SNPRINTF;
return precision < 0 ? snprintf_ptr(buf, size, format, value)
: snprintf_ptr(buf, size, format, precision, value);
}
template <typename T>
......
......@@ -70,10 +70,6 @@
// Disable the warning about declaration shadowing because it affects too
// many valid cases.
# pragma GCC diagnostic ignored "-Wshadow"
// Disable the warning about nonliteral format strings because we construct
// them dynamically when falling back to snprintf for FP formatting.
# pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
#if FMT_CLANG_VERSION
......
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