From cfe875e72ebfe283dbc771e8387d8ef0b10d1995 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Sun, 5 Dec 2010 01:19:45 +0100 Subject: [PATCH] Add -Wall and -Werror for GCC --- configure.ac | 15 +++++++++++++++ tests/bandwidth-server-many-up.c | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 05edb05..cf10b51 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,21 @@ AC_CHECK_DECLS([__CYGWIN__]) AC_FUNC_FORK AC_CHECK_FUNCS([gettimeofday inet_ntoa memset select socket strerror strlcpy]) +# Add -Wall -Werror for GCC if not already there +if test "x$GCC" = "xyes"; then + case " $CFLAGS " in + *[[\ \ ]]-Wall[[\ \ ]]*) ;; + *) CFLAGS="$CFLAGS -Wall" ;; + esac +fi + +if test "x$GCC" = "xyes"; then + case " $CFLAGS " in + *[[\ \ ]]-Werror[[\ \ ]]*) ;; + *) CFLAGS="$CFLAGS -Werror" ;; + esac +fi + AC_CONFIG_FILES([ Makefile src/Makefile diff --git a/tests/bandwidth-server-many-up.c b/tests/bandwidth-server-many-up.c index 989b4b0..5297c0a 100644 --- a/tests/bandwidth-server-many-up.c +++ b/tests/bandwidth-server-many-up.c @@ -28,7 +28,6 @@ #include #else #include -/* Required by inet_ntoa() to avoid a segfault! */ #include #endif -- libgit2 0.21.4