chiark / gitweb /
Work around stupid excessively strict warning in GCC 4.4.
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 2 May 2009 10:12:21 +0000 (11:12 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sat, 2 May 2009 10:12:21 +0000 (11:12 +0100)
clients/playrtp.c
configure.ac

index 4e27ebf..5b1e496 100644 (file)
@@ -324,6 +324,9 @@ static void *queue_thread(void attribute((unused)) *arg) {
     pthread_cond_broadcast(&cond);
     pthread_mutex_unlock(&lock);
   }
+#if HAVE_STUPID_GCC44
+  return NULL;
+#endif
 }
 
 /** @brief Background thread collecting samples
index 94cffce..4222ee0 100644 (file)
@@ -697,6 +697,25 @@ if test "x$GCC" = xyes; then
     gcc_werror=''
   fi
 
+  AC_CACHE_CHECK([checking for excessively strict -Wreturn-type],
+                 [rjk_cv_gcc44_stupidity],[
+    old_CC="$CC"
+    if test $GCC = yes; then
+      CC="$CC -Wreturn-type -Werror"
+    fi
+    AC_COMPILE_IFELSE([
+      static void *threadfn(void) {
+        for(;;)
+          ;
+      }],
+      [rjk_cv_gcc44_stupidity=no],
+      [rjk_cv_gcc44_stupidity=yes])
+    CC="$old_CC"
+  ])
+  if test $rjk_cv_gcc44_stupidity = yes; then
+    AC_DEFINE([HAVE_STUPID_GCC44],[1],[Define if your compiler has excessively strict -Wreturn-type])
+  fi
+
   # a reasonable default set of warnings
   CC="${CC} -Wall -W -Wpointer-arith -Wbad-function-cast \
        -Wwrite-strings -Wmissing-prototypes \