summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRichardHitt <rbh00@netcom.com>2013-04-22 11:22:04 -0700
committerRichardHitt <rbh00@netcom.com>2013-04-22 11:22:04 -0700
commitba1dfabf116f060b243c65d0c400be1318f99047 (patch)
treee9f4d6364253f2e87ecf8a17f647a521adba588e
parent9603248a5bee98ce25a9d6361f3f3f89b3033441 (diff)
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 *********************************************************************