From 3504545ff8dc818d08ac9526589b981a9a21c7a6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 10 Apr 2016 14:39:52 +0300 Subject: Add pragma for clang for disable some warnings. --- src/localconsts.h | 8 ++++++++ src/test/testlauncher.cpp | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/localconsts.h b/src/localconsts.h index dd8da46f3..eeb1d657e 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -160,9 +160,17 @@ #define PRAGMA6(str) #endif // ADVGCC +#ifdef __clang__ +#define PRAGMACLANG(str) _Pragma(#str) +#else // __clang__ +#define PRAGMACLANG(str) +#endif // __clang__ + #ifdef __GNUC__ #if GCC_VERSION > 40500 #define PRAGMA45(str) _Pragma(#str) +#elif defined(__clang__) +#define PRAGMA45(str) _Pragma(#str) #else // GCC_VERSION > 40400 #define PRAGMA45(str) #endif // GCC_VERSION > 40400 diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index 2b86a3eca..8909b29ee 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -151,6 +151,9 @@ int TestLauncher::testRescale() const return 0; } +PRAGMACLANG(GCC diagnostic push) +PRAGMACLANG(GCC diagnostic ignored "-Wunused-result") + int TestLauncher::testFps() { timeval start; @@ -279,6 +282,7 @@ int TestLauncher::testFps3() sleep(1); return 0; } +PRAGMACLANG(GCC diagnostic pop) int TestLauncher::testBatches() { @@ -371,6 +375,9 @@ int TestLauncher::testTextures() return 0; } +PRAGMACLANG(GCC diagnostic push) +PRAGMACLANG(GCC diagnostic ignored "-Wunused-result") + int TestLauncher::testInternal() { timeval start; @@ -421,6 +428,8 @@ int TestLauncher::testInternal() return 0; } +PRAGMACLANG(GCC diagnostic pop) + int TestLauncher::testDye() { SDL_RWops *rw = MPHYSFSRWOPS_openRead( -- cgit v1.2.3-70-g09d2