From d96c5bd464869cd7fd491f570c0e569a9614c2ff Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Mon, 5 Oct 2020 21:32:21 +0200 Subject: [PATCH 1/2] Fix clang warning about unused function --- src/util/logging.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/logging.cpp b/src/util/logging.cpp index c967947789f..c81be3de659 100644 --- a/src/util/logging.cpp +++ b/src/util/logging.cpp @@ -41,6 +41,9 @@ enum class WriteFlag { Q_DECLARE_FLAGS(WriteFlags, WriteFlag) +#if defined(__clang__) +#pragma clang diagnostic ignored "-Wunused-function" +#endif Q_DECLARE_OPERATORS_FOR_FLAGS(WriteFlags) // Handles actually writing to stderr and the log file. From bd532d02939388f6bb1e1c18486e9c030d063f4c Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Thu, 29 Oct 2020 12:17:57 +0100 Subject: [PATCH 2/2] Restrict Clang 10 warning workaround --- src/util/logging.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/logging.cpp b/src/util/logging.cpp index c81be3de659..81e55cb4400 100644 --- a/src/util/logging.cpp +++ b/src/util/logging.cpp @@ -41,10 +41,16 @@ enum class WriteFlag { Q_DECLARE_FLAGS(WriteFlags, WriteFlag) +// Clang 10 complains about an unused function introduced by +// Q_DECLARE_OPERATORS_FOR_FLAGS #if defined(__clang__) +#pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" #endif Q_DECLARE_OPERATORS_FOR_FLAGS(WriteFlags) +#if defined(__clang__) +#pragma clang diagnostic pop +#endif // Handles actually writing to stderr and the log file. inline void writeToLog(