]> granicus.if.org Git - apache/commitdiff
The GCC flag "-Wno-error=comment" introduced by r1855446
authorRainer Jung <rjung@apache.org>
Mon, 5 Aug 2019 14:18:22 +0000 (14:18 +0000)
committerRainer Jung <rjung@apache.org>
Mon, 5 Aug 2019 14:18:22 +0000 (14:18 +0000)
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

modules/filters/config.m4
modules/filters/mod_proxy_html.c
modules/filters/mod_xml2enc.c

index f647f54e83cfe8cbe6df92b45b74c6c7fec276da..3a3cf3d4d0dcbc64cc6c4d084277f3a914e55420 100644 (file)
@@ -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
index ec0259ce0c62e77b3f2935c38fceafcf3e3e484d..e1fb23c915535226aeb50f2319417dcbe268f16a 100644 (file)
 #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"
index 2d7daecc90b7fe543e2adc4e6eb82e487c7872d5..34f9ea45d4f9e8f692b2eaafbc4bf025d8e7a95f 100644 (file)
 
 #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"