From f216d82052b8977080dc325d104ee66897b07c56 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 23 May 2018 08:46:37 +0300 Subject: Fix warnings in new clang5 builds. --- src/localconsts.h | 5 +++++ src/net/sdltcpnet.h | 3 +++ src/unittests/utils/dumplibs.cc | 3 +++ src/utils/dumplibs.cpp | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/src/localconsts.h b/src/localconsts.h index 10ec5e110..86df45ee0 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -204,6 +204,11 @@ #ifdef __clang__ #define PRAGMACLANG(str) _Pragma(#str) +#if CLANG_VERSION >= 50000 +#define PRAGMACLANG5(str) _Pragma(#str) +#else // CLANG_VERSION >= 50000 +#define PRAGMACLANG5(str) +#endif // CLANG_VERSION >= 50000 #if CLANG_VERSION >= 30800 #define PRAGMACLANG6(str) _Pragma(#str) #define CLANG_FALLTHROUGH [[clang::fallthrough]]; diff --git a/src/net/sdltcpnet.h b/src/net/sdltcpnet.h index ca3c3555f..e00a05f85 100644 --- a/src/net/sdltcpnet.h +++ b/src/net/sdltcpnet.h @@ -23,10 +23,13 @@ #include "localconsts.h" +PRAGMACLANG5(GCC diagnostic push) +PRAGMACLANG5(GCC diagnostic ignored "-Wzero-as-null-pointer-constant") PRAGMA48(GCC diagnostic push) PRAGMA48(GCC diagnostic ignored "-Wshadow") #include PRAGMA48(GCC diagnostic pop) +PRAGMACLANG5(GCC diagnostic pop) namespace TcpNet { diff --git a/src/unittests/utils/dumplibs.cc b/src/unittests/utils/dumplibs.cc index 475b2e371..e7b68e470 100644 --- a/src/unittests/utils/dumplibs.cc +++ b/src/unittests/utils/dumplibs.cc @@ -26,10 +26,13 @@ PRAGMA48(GCC diagnostic push) PRAGMA48(GCC diagnostic ignored "-Wshadow") #include #include +PRAGMACLANG5(GCC diagnostic push) +PRAGMACLANG5(GCC diagnostic ignored "-Wzero-as-null-pointer-constant") PRAGMACLANG6GCC(GCC diagnostic push) PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast") #include PRAGMACLANG6GCC(GCC diagnostic pop) +PRAGMACLANG5(GCC diagnostic pop) #include PRAGMA48(GCC diagnostic pop) diff --git a/src/utils/dumplibs.cpp b/src/utils/dumplibs.cpp index d712f1245..57ce0c493 100644 --- a/src/utils/dumplibs.cpp +++ b/src/utils/dumplibs.cpp @@ -29,10 +29,14 @@ PRAGMA48(GCC diagnostic push) PRAGMA48(GCC diagnostic ignored "-Wshadow") #include #include + +PRAGMACLANG5(GCC diagnostic push) +PRAGMACLANG5(GCC diagnostic ignored "-Wzero-as-null-pointer-constant") PRAGMACLANG6GCC(GCC diagnostic push) PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast") #include PRAGMACLANG6GCC(GCC diagnostic pop) +PRAGMACLANG5(GCC diagnostic pop) #include PRAGMA48(GCC diagnostic pop) -- cgit v1.2.3-70-g09d2