util/RuntimeError: disable -Wformat-security as a kludge

This commit is contained in:
Max Kellermann 2021-05-19 14:57:15 +02:00
parent c3f9b38c97
commit 28e7be248f
1 changed files with 10 additions and 0 deletions

View File

@ -35,6 +35,12 @@
#include <stdio.h>
#ifdef __clang__
#pragma GCC diagnostic push
// TODO: fix this warning properly
#pragma GCC diagnostic ignored "-Wformat-security"
#endif
template<typename... Args>
static inline std::runtime_error
FormatRuntimeError(const char *fmt, Args&&... args) noexcept
@ -53,4 +59,8 @@ FormatInvalidArgument(const char *fmt, Args&&... args) noexcept
return std::invalid_argument(buffer);
}
#ifdef __clang__
#pragma GCC diagnostic pop
#endif
#endif