summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTingPing <tngpng@gmail.com>2013-04-22 13:54:45 -0700
committerTingPing <tngpng@gmail.com>2013-04-22 13:54:45 -0700
commit075c5dfad6878a930836cdb08f36da92d3c7f430 (patch)
treee9f4d6364253f2e87ecf8a17f647a521adba588e
parent9603248a5bee98ce25a9d6361f3f3f89b3033441 (diff)
parentba1dfabf116f060b243c65d0c400be1318f99047 (diff)
Merge pull request #556 from RichardHitt/ignore-unused
Fix Ubuntu build warnings by using gcc flag -Wno-unused-result
-rw-r--r--configure.ac22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index a7c254f4..6eb5b97e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -811,6 +811,28 @@ if test x$unsigned_char = xyes; then
 	CFLAGS="$CFLAGS -funsigned-char"
 fi
 
+dnl does this compiler support -Wno-unused-result ?
+AC_MSG_CHECKING([if gcc accepts -Wno-unused-result ])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wno-unused-result"
+
+AC_TRY_COMPILE(, [
+int main () { return 0 ; }
+],
+[
+no_unused_result=yes
+AC_MSG_RESULT([yes])
+], [
+no_unused_result=no
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+if test x$no_unused_result = xyes; then
+	CFLAGS="$CFLAGS -Wno-unused-result"
+fi
+
 dnl *********************************************************************
 dnl ** FUNCTIONS/LIBS/CFLAGS ********************************************
 dnl *********************************************************************