diff options
author | Peter Powell <petpow@saberuk.com> | 2014-01-24 23:27:34 +0000 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-28 14:30:48 +0200 |
commit | 8a28e50cd2f19c2766b3ed2278ad237ad788620a (patch) | |
tree | 95056002e1dde1106003db84edb1291bd283d66a | |
parent | 1cf85908164d97dfa385c75b9f817905a8a75e78 (diff) |
Ignore safe compiler warnings in a more reliable way.
-rw-r--r-- | src/modules/extra/m_regex_re2.cpp | 14 | ||||
-rw-r--r-- | src/modules/extra/m_sqlite3.cpp | 12 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 14 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 18 |
4 files changed, 38 insertions, 20 deletions
diff --git a/src/modules/extra/m_regex_re2.cpp b/src/modules/extra/m_regex_re2.cpp index 544e3060e..c4657bf8b 100644 --- a/src/modules/extra/m_regex_re2.cpp +++ b/src/modules/extra/m_regex_re2.cpp @@ -18,16 +18,20 @@ */ -#if defined __GNUC__ +#include "inspircd.h" +#include "modules/regex.h" + +// Fix warnings about the use of `long long` on C++03 and +// shadowing on GCC. +#if defined __clang__ +# pragma clang diagnostic ignored "-Wc++11-long-long" +#elif defined __GNUC__ +# pragma GCC diagnostic ignored "-Wlong-long" # pragma GCC diagnostic ignored "-Wshadow" #endif -#include "inspircd.h" -#include "modules/regex.h" #include <re2/re2.h> - -/* $CompileFlags: -std=c++11 */ /* $LinkerFlags: -lre2 */ class RE2Regex : public Regex diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index 1c213e8e0..f86e08fb3 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -21,14 +21,22 @@ #include "inspircd.h" -#include <sqlite3.h> #include "modules/sql.h" +// Fix warnings about the use of `long long` on C++03. +#if defined __clang__ +# pragma clang diagnostic ignored "-Wc++11-long-long" +#elif defined __GNUC__ +# pragma GCC diagnostic ignored "-Wlong-long" +#endif + +#include <sqlite3.h> + #ifdef _WIN32 # pragma comment(lib, "sqlite3.lib") #endif -/* $CompileFlags: pkgconfversion("sqlite3","3.3") pkgconfincludes("sqlite3","/sqlite3.h","") -Wno-pedantic */ +/* $CompileFlags: pkgconfversion("sqlite3","3.3") pkgconfincludes("sqlite3","/sqlite3.h","") */ /* $LinkerFlags: pkgconflibs("sqlite3","/libsqlite3.so","-lsqlite3") */ class SQLConn; diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index a2c58cf86..462209e01 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -22,11 +22,19 @@ #include "inspircd.h" -#include <gnutls/gnutls.h> -#include <gnutls/x509.h> #include "modules/ssl.h" #include <memory> +// Fix warnings about the use of commas at end of enumerator lists on C++03. +#if defined __clang__ +# pragma clang diagnostic ignored "-Wc++11-extensions" +#elif defined __GNUC__ +# pragma GCC diagnostic ignored "-pedantic" +#endif + +#include <gnutls/gnutls.h> +#include <gnutls/x509.h> + #if ((GNUTLS_VERSION_MAJOR > 2) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR > 9) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR == 9 && GNUTLS_VERSION_PATCH >= 8)) #define GNUTLS_HAS_MAC_GET_ID #include <gnutls/crypto.h> @@ -49,7 +57,7 @@ # pragma comment(lib, "gdi32.lib") #endif -/* $CompileFlags: pkgconfincludes("gnutls","/gnutls/gnutls.h","") eval("print `libgcrypt-config --cflags | tr -d \r` if `pkg-config --modversion gnutls 2>/dev/null | tr -d \r` lt '2.12'") -Wno-pedantic */ +/* $CompileFlags: pkgconfincludes("gnutls","/gnutls/gnutls.h","") eval("print `libgcrypt-config --cflags | tr -d \r` if `pkg-config --modversion gnutls 2>/dev/null | tr -d \r` lt '2.12'") */ /* $LinkerFlags: rpath("pkg-config --libs gnutls") pkgconflibs("gnutls","/libgnutls.so","-lgnutls") eval("print `libgcrypt-config --libs | tr -d \r` if `pkg-config --modversion gnutls 2>/dev/null | tr -d \r` lt '2.12'") */ #ifndef GNUTLS_VERSION_MAJOR diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 0ce36ed80..9ebc0de9d 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -21,20 +21,18 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - /* HACK: This prevents OpenSSL on OS X 10.7 and later from spewing deprecation - * warnings for every single function call. As far as I (SaberUK) know, Apple - * have no plans to remove OpenSSL so this warning just causes needless spam. - */ -#ifdef __APPLE__ -# define __AVAILABILITYMACROS__ -# define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER -#endif #include "inspircd.h" #include "iohook.h" +#include "modules/ssl.h" + +// Ignore OpenSSL deprecation warnings on OS X Lion and newer. +#if defined __APPLE__ +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + #include <openssl/ssl.h> #include <openssl/err.h> -#include "modules/ssl.h" #ifdef _WIN32 # pragma comment(lib, "libcrypto.lib") @@ -46,7 +44,7 @@ # pragma comment(lib, "gdi32.lib") #endif -/* $CompileFlags: pkgconfversion("openssl","0.9.7") pkgconfincludes("openssl","/openssl/ssl.h","") -Wno-pedantic */ +/* $CompileFlags: pkgconfversion("openssl","0.9.7") pkgconfincludes("openssl","/openssl/ssl.h","") */ /* $LinkerFlags: rpath("pkg-config --libs openssl") pkgconflibs("openssl","/libssl.so","-lssl -lcrypto") */ enum issl_status { ISSL_NONE, ISSL_HANDSHAKING, ISSL_OPEN }; |