summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-09-23 17:23:22 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-09-23 17:23:22 (GMT)
commit7ddbf10589a64efd884ab002b79665559f45019e (patch)
tree532aba654de1b186e093fe529949a26bd65ed2ce /configure.in
parenta1fe1f8dcfd43059c38b1493ec67af06fd2afe7f (diff)
downloadcpython-7ddbf10589a64efd884ab002b79665559f45019e.zip
cpython-7ddbf10589a64efd884ab002b79665559f45019e.tar.gz
cpython-7ddbf10589a64efd884ab002b79665559f45019e.tar.bz2
disable unused result warnings when possible
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 315a832..d5f00b2 100644
--- a/configure.in
+++ b/configure.in
@@ -981,6 +981,28 @@ yes)
BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
fi
+ AC_MSG_CHECKING(if we can turn off $CC unused result warning)
+ ac_save_cc="$CC"
+ CC="$CC -Wunused-result -Werror"
+ save_CFLAGS="$CFLAGS"
+ AC_CACHE_VAL(ac_cv_disable_unused_result_warning,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_disable_unused_result_warning=yes
+ ],[
+ ac_cv_disable_unused_result_warning=no
+ ]))
+ CFLAGS="$save_CFLAGS"
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_disable_unused_result_warning)
+
+ if test $ac_cv_disable_unused_result_warning = yes
+ then
+ BASECFLAGS="$BASECFLAGS -Wno-unused-result"
+ fi
+
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
# support. Without this, treatment of subnormals doesn't follow
# the standard.