From: msweet Date: Tue, 23 Jun 2015 14:48:53 +0000 (+0000) Subject: Add a check for whether the compiler supports the -Wno-unused-result option. X-Git-Tag: v2.2b1~253 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e87e23e76e9d133ce78e3ee56f2a60a2453875ae;p=thirdparty%2Fcups.git Add a check for whether the compiler supports the -Wno-unused-result option. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12742 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 index 5f92d8b68d..3c2076aa1b 100644 --- a/config-scripts/cups-compiler.m4 +++ b/config-scripts/cups-compiler.m4 @@ -154,7 +154,16 @@ if test -n "$GCC"; then if test "x$with_optim" = x; then # Add useful warning options for tracking down problems... - OPTIM="-Wall -Wno-format-y2k -Wunused -Wno-unused-result $OPTIM" + OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM" + + AC_MSG_CHECKING(whether compiler supports -Wno-unused-result) + OLDCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-unused-result" + AC_TRY_COMPILE(,, + [OPTIM="$OPTIM -Wno-unused-result" + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no)) + CFLAGS="$OLDCFLAGS" AC_MSG_CHECKING(whether compiler supports -Wsign-conversion) OLDCFLAGS="$CFLAGS"