From 28e7be248f7aef8ae9bef5db737f016106514fca Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 19 May 2021 14:57:15 +0200 Subject: [PATCH] util/RuntimeError: disable -Wformat-security as a kludge --- src/util/RuntimeError.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/util/RuntimeError.hxx b/src/util/RuntimeError.hxx index 3d523013b..962bad67b 100644 --- a/src/util/RuntimeError.hxx +++ b/src/util/RuntimeError.hxx @@ -35,6 +35,12 @@ #include +#ifdef __clang__ +#pragma GCC diagnostic push +// TODO: fix this warning properly +#pragma GCC diagnostic ignored "-Wformat-security" +#endif + template 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