From c6a70f38f22abf3c46914b85ff620975f12bf027 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sat, 2 May 2009 11:12:21 +0100 Subject: [PATCH] Work around stupid excessively strict warning in GCC 4.4. Organization: Straylight/Edgeware From: Richard Kettlewell --- clients/playrtp.c | 3 +++ configure.ac | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/clients/playrtp.c b/clients/playrtp.c index 4e27ebf..5b1e496 100644 --- a/clients/playrtp.c +++ b/clients/playrtp.c @@ -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 diff --git a/configure.ac b/configure.ac index 94cffce..4222ee0 100644 --- a/configure.ac +++ b/configure.ac @@ -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 \ -- [mdw]