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
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
#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"
#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"