From 293983ea71dbffb4923072b061e7b9748846c056 Mon Sep 17 00:00:00 2001 From: orbea Date: Sat, 12 Oct 2019 19:14:40 +0000 Subject: [PATCH] common: Silence -Wunused-function clang warnings. (#3127) v2: Use pragma instead of [[maybe_unused]]. v3: Silence warnings with older clang versions too. --- common/include/Utilities/gtkGuiTools.h | 9 +++++++++ common/include/x86emitter/x86_intrin.h | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/common/include/Utilities/gtkGuiTools.h b/common/include/Utilities/gtkGuiTools.h index e50520a894..54d450fa05 100644 --- a/common/include/Utilities/gtkGuiTools.h +++ b/common/include/Utilities/gtkGuiTools.h @@ -34,6 +34,11 @@ // on what it's built for. // +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" +#endif + static GtkWidget *ps_gtk_hbox_new(int padding = 5) { #if GTK_MAJOR_VERSION < 3 @@ -131,3 +136,7 @@ static void pcsx2_message(const wchar_t *fmt, ...) gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif diff --git a/common/include/x86emitter/x86_intrin.h b/common/include/x86emitter/x86_intrin.h index 91a9242cb1..5ee21d892e 100644 --- a/common/include/x86emitter/x86_intrin.h +++ b/common/include/x86emitter/x86_intrin.h @@ -69,16 +69,21 @@ static __inline__ __attribute__((always_inline)) unsigned long long xgetbv(unsig // Rotate instruction #if defined(__clang__) && __clang_major__ < 9 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" + // Seriously what is so complicated to provided this bunch of intrinsics in clangs. -[[maybe_unused]] static unsigned int _rotr(unsigned int x, int s) +static unsigned int _rotr(unsigned int x, int s) { return (x >> s) | (x << (32 - s)); } -[[maybe_unused]] static unsigned int _rotl(unsigned int x, int s) +static unsigned int _rotl(unsigned int x, int s) { return (x << s) | (x >> (32 - s)); } + +#pragma clang diagnostic pop #endif // Not correctly defined in GCC4.8 and below ! (dunno for VS)