Skip to content
Permalink
Browse files

common: Silence -Wunused-function clang warnings. (#3127)

v2: Use pragma instead of [[maybe_unused]].
v3: Silence warnings with older clang versions too.
  • Loading branch information...
orbea authored and arcum42 committed Oct 12, 2019
1 parent 7bf920b commit 293983ea71dbffb4923072b061e7b9748846c056
Showing with 16 additions and 2 deletions.
  1. +9 −0 common/include/Utilities/gtkGuiTools.h
  2. +7 −2 common/include/x86emitter/x86_intrin.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
@@ -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)

0 comments on commit 293983e

Please sign in to comment.
You can’t perform that action at this time.