summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Jung <rjung@apache.org>2019-08-05 16:18:22 +0200
committerRainer Jung <rjung@apache.org>2019-08-05 16:18:22 +0200
commit40581b93919fbb18bc93c687d11db8e98f70fbfb (patch)
tree08ef85325086d7684917ce9cc56b5d83feb01f4e
parent *) mod_ssl: reverting a 2.4.40 change where a superfluous SSLCertificateCha... (diff)
downloadapache2-40581b93919fbb18bc93c687d11db8e98f70fbfb.tar.xz
apache2-40581b93919fbb18bc93c687d11db8e98f70fbfb.zip
The GCC flag "-Wno-error=comment" introduced by r1855446
and r1850745 are only known since GCC 4.2. Since it gets set unconditionally, this breaks compilation with old GCC even when not using maintainer mode. Make the fix for maintainer mode more specific by using a version dependent pragma in the relevant two C files only switching off error status for comment warnings. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864435 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/filters/config.m44
-rw-r--r--modules/filters/mod_proxy_html.c19
-rw-r--r--modules/filters/mod_xml2enc.c21
3 files changed, 40 insertions, 4 deletions
diff --git a/modules/filters/config.m4 b/modules/filters/config.m4
index f647f54e83..3a3cf3d4d0 100644
--- a/modules/filters/config.m4
+++ b/modules/filters/config.m4
@@ -114,10 +114,6 @@ AC_DEFUN([FIND_LIBXML2], [
if test -n "${xml2_path}" ; then
ac_cv_libxml2=yes
XML2_INCLUDES="${xml2_path}"
- dnl libxml2 includes unicode/*.h files which uses C++ comments
- if test "$GCC" = "yes"; then
- APR_ADDTO(MOD_CPPFLAGS, ["-Wno-error=comment"])
- fi
else
ac_cv_libxml2=no
fi
diff --git a/modules/filters/mod_proxy_html.c b/modules/filters/mod_proxy_html.c
index ec0259ce0c..e1fb23c915 100644
--- a/modules/filters/mod_proxy_html.c
+++ b/modules/filters/mod_proxy_html.c
@@ -29,9 +29,28 @@
#define VERBOSEB(x) if (verbose) {x}
#endif
+/* libxml2 includes unicode/*.h files which uses C++ comments */
+#if defined(__GNUC__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic push
+#endif
+#pragma GCC diagnostic ignored "-Werror=comment"
+#elif defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Werror=comment"
+#endif
+
/* libxml2 */
#include <libxml/HTMLparser.h>
+#if defined(__GNUC__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic pop
+#endif
+#elif defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
#include "http_protocol.h"
#include "http_config.h"
#include "http_log.h"
diff --git a/modules/filters/mod_xml2enc.c b/modules/filters/mod_xml2enc.c
index 2d7daecc90..34f9ea45d4 100644
--- a/modules/filters/mod_xml2enc.c
+++ b/modules/filters/mod_xml2enc.c
@@ -23,9 +23,30 @@
#include <ctype.h>
+/* libxml2 includes unicode/*.h files which uses C++ comments */
+#if defined(__GNUC__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic push
+#endif
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
+#pragma GCC diagnostic ignored "-Werror=comment"
+#endif
+#elif defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Werror=comment"
+#endif
+
/* libxml2 */
#include <libxml/encoding.h>
+#if defined(__GNUC__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic pop
+#endif
+#elif defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
#include "http_protocol.h"
#include "http_config.h"
#include "http_log.h"