Don't check HAVE_GCC_ATTRIBUTE_WARN_UNUSED on MSVC

...where -Werror -Wunknown-pragmas command line arguments will trivially make
the test always fail, anyway

Change-Id: Iae5534054331d41508f39d5cf141803ab5bc8ba7
This commit is contained in:
Stephan Bergmann 2017-02-23 12:50:19 +01:00
parent f89f9aa6ad
commit cd23b010a2

View File

@ -6041,20 +6041,20 @@ if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
AC_MSG_RESULT([yes])])
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
fi
AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -Werror -Wunknown-pragmas"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
struct __attribute__((warn_unused)) dummy {};
])], [
AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
AC_MSG_RESULT([yes])
], [AC_MSG_RESULT([no])])
CXXFLAGS=$save_CXXFLAGS
AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -Werror -Wunknown-pragmas"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
struct __attribute__((warn_unused)) dummy {};
])], [
AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
AC_MSG_RESULT([yes])
], [AC_MSG_RESULT([no])])
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
fi
AC_SUBST(HAVE_GCC_AVX)
AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)