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 4e27ebf9be363f0a68ca5af6f9386214f6b612e2..5b1e496667a28c4753646653c253d09cb637cf97 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 94cffceb9ffedd609b8be9fde62e037c2ba49ba9..4222ee05c741aeca5e3e2b32e49c59e30ca3b4e5 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 \