]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Suppress the Wredundant-decls warning in another set of openssl headers
authorNick Mathewson <nickm@torproject.org>
Tue, 14 Jun 2016 16:17:02 +0000 (12:17 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 14 Jun 2016 16:17:02 +0000 (12:17 -0400)
src/tools/tor-gencert.c

index c05066722aa8e28ae83b52897757ad1accc11ca4..5f2cd3a92d3ec6a48f035e0c55d61f7acc067bb9 100644 (file)
 #include <unistd.h>
 #endif
 
+#ifdef __GNUC__
+#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+#endif
+
+#if __GNUC__ && GCC_VERSION >= 402
+#if GCC_VERSION >= 406
+#pragma GCC diagnostic push
+#endif
+/* Some versions of OpenSSL declare X509_STORE_CTX_set_verify_cb twice in
+ * x509.h and x509_vfy.h. Suppress the GCC warning so we can build with
+ * -Wredundant-decl. */
+#pragma GCC diagnostic ignored "-Wredundant-decls"
+#endif
+
 #include <openssl/evp.h>
 #include <openssl/pem.h>
 #include <openssl/rsa.h>
 #include <openssl/obj_mac.h>
 #include <openssl/err.h>
 
+#if __GNUC__ && GCC_VERSION >= 402
+#if GCC_VERSION >= 406
+#pragma GCC diagnostic pop
+#else
+#pragma GCC diagnostic warning "-Wredundant-decls"
+#endif
+#endif
+
 #include <errno.h>
 #if 0
 #include <stdlib.h>