- AS_IF([test "$ac_cv_safe_to_use_Wattributes_" = "yes"],
- [],
- [CXX_WARNINGS="${CXX_WARNINGS} -Wno-attributes"])
+ AC_CACHE_CHECK([whether it is safe to use -Wno-attributes],
+ [ac_cv_safe_to_use_Wno_attributes_],
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="${W_FAIL} -pedantic -Wno_attributes_ ${AM_CFLAGS} ${CFLAGS}"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+#include <stdio.h>
+ ]], [[]])
+ ],
+ [ac_cv_safe_to_use_Wno_attributes_=yes],
+ [ac_cv_safe_to_use_Wno_attributes_=no])
+ CFLAGS="$save_CFLAGS"])
+
+ dnl GCC 3.4 doesn't have -Wno-attributes, so we can't turn them off
+ dnl by using that.
+ AS_IF([test "$ac_cv_safe_to_use_Wattributes_" != "yes"],[
+ AS_IF([test "$ac_cv_safe_to_use_Wno_attributes_" = "yes"],[
+ CC_WARNINGS="${CC_WARNINGS} -Wno-attributes"
+ NO_ATTRIBUTES="-Wno-attributes"])])
+