]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add a check for whether the compiler supports the -Wno-unused-result option.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 23 Jun 2015 14:48:53 +0000 (14:48 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 23 Jun 2015 14:48:53 +0000 (14:48 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12742 a1ca3aef-8c08-0410-bb20-df032aa958be

config-scripts/cups-compiler.m4

index 5f92d8b68dd924f6610f582eeac8b1615fcbd2a4..3c2076aa1b46596ad028d88c5b601e454b6759e2 100644 (file)
@@ -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"