+
+ AC_CACHE_CHECK([whether it is safe to use -Wattributes from C++],
+ [ac_cv_safe_to_use_Wattributes_],
+ [AC_LANG_PUSH(C++)
+ save_CXXFLAGS="${CXXFLAGS}"
+ CXXFLAGS="${W_FAIL} -pedantic -Wattributes -fvisibility=hidden ${AM_CXXFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+#include <google/protobuf/message.h>
+#include <google/protobuf/descriptor.h>
+
+
+const ::google::protobuf::EnumDescriptor* Table_TableOptions_RowType_descriptor();
+enum Table_TableOptions_RowType {
+ Table_TableOptions_RowType_ROW_TYPE_DEFAULT = 0,
+ Table_TableOptions_RowType_ROW_TYPE_FIXED = 1,
+ Table_TableOptions_RowType_ROW_TYPE_DYNAMIC = 2,
+ Table_TableOptions_RowType_ROW_TYPE_COMPRESSED = 3,
+ Table_TableOptions_RowType_ROW_TYPE_REDUNDANT = 4,
+ Table_TableOptions_RowType_ROW_TYPE_COMPACT = 5,
+ Table_TableOptions_RowType_ROW_TYPE_PAGE = 6
+};
+
+namespace google {
+namespace protobuf {
+template <>
+inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
+ return Table_TableOptions_RowType_descriptor();
+}
+}
+}
+ ])],
+ [ac_cv_safe_to_use_Wattributes_=yes],
+ [ac_cv_safe_to_use_Wattributes_=no])
+ CXXFLAGS="${save_CXXFLAGS}"
+ AC_LANG_POP()])
+ 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"])])
+