You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rj...@apache.org on 2019/08/05 14:18:22 UTC

svn commit: r1864435 - in /httpd/httpd/trunk/modules/filters: config.m4 mod_proxy_html.c mod_xml2enc.c

Author: rjung
Date: Mon Aug  5 14:18:22 2019
New Revision: 1864435

URL: http://svn.apache.org/viewvc?rev=1864435&view=rev
Log:
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.

Modified:
    httpd/httpd/trunk/modules/filters/config.m4
    httpd/httpd/trunk/modules/filters/mod_proxy_html.c
    httpd/httpd/trunk/modules/filters/mod_xml2enc.c

Modified: httpd/httpd/trunk/modules/filters/config.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/config.m4?rev=1864435&r1=1864434&r2=1864435&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/config.m4 (original)
+++ httpd/httpd/trunk/modules/filters/config.m4 Mon Aug  5 14:18:22 2019
@@ -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

Modified: httpd/httpd/trunk/modules/filters/mod_proxy_html.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_proxy_html.c?rev=1864435&r1=1864434&r2=1864435&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_proxy_html.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_proxy_html.c Mon Aug  5 14:18:22 2019
@@ -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"

Modified: httpd/httpd/trunk/modules/filters/mod_xml2enc.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_xml2enc.c?rev=1864435&r1=1864434&r2=1864435&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_xml2enc.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_xml2enc.c Mon Aug  5 14:18:22 2019
@@ -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"