From ba1dfabf116f060b243c65d0c400be1318f99047 Mon Sep 17 00:00:00 2001 From: RichardHitt Date: Mon, 22 Apr 2013 11:22:04 -0700 Subject: [PATCH] Fix Ubuntu build warnings by using gcc flag -Wno-unused-result --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 *********************************************************************