diff --git a/configure.in b/configure.in index 8facc38e2..d6e3b5d16 100644 --- a/configure.in +++ b/configure.in @@ -886,23 +886,26 @@ AC_CACHE_CHECK([for supported warning flags], cairo_cv_warn_cflags, [ cairo_cv_warn_cflags=$WARN_CFLAGS cairo_cv_warn_maybe=$MAYBE_WARN - AC_MSG_CHECKING([which warning flags were supported])]) + AC_MSG_CHECKING([which warning flags were supported]) +]) WARN_CFLAGS="$cairo_cv_warn_cflags" CAIRO_CFLAGS="$CAIRO_CFLAGS $WARN_CFLAGS" # We only wish to enable attribute(warn_unused_result) if we can prevent # gcc from generating thousands of warnings about the misapplication of the # attribute to void functions and variables. -AC_MSG_CHECKING([how to enable unused result warnings]) -warn_unused_result="" -if echo $WARN_CFLAGS | grep -e '-Wno-attributes' >/dev/null; then - AC_TRY_COMPILE([__attribute__((__warn_unused_result__)) - int f (int i) { return i; }], [], - [warn_unused_result="__attribute__((__warn_unused_result__))"]) -fi -AC_DEFINE_UNQUOTED([WARN_UNUSED_RESULT], [$warn_unused_result], +AC_CACHE_CHECK([how to enable unused result warnings], cairo_cv_warn_unused_result, [ + cairo_cv_warn_unused_result="" + if echo $WARN_CFLAGS | grep -e '-Wno-attributes' >/dev/null; then + AC_TRY_COMPILE([__attribute__((__warn_unused_result__)) + int f (int i) { return i; }], [], + [cairo_cv_warn_unused_result="__attribute__((__warn_unused_result__))"]) + fi +]) +AC_DEFINE_UNQUOTED([WARN_UNUSED_RESULT], [$cairo_cv_warn_unused_result], [Define to the value your compiler uses to support the warn-unused-result attribute]) -AC_MSG_RESULT([$warn_unused_result]) + +dnl =========================================================================== AC_SUBST(CAIRO_REQUIRES) AC_SUBST(CAIRO_NONPKGCONFIG_CFLAGS)