Эх сурвалжийг харах

Add -Wall and -Werror for GCC

- removed comment not required anymore with -Wall -Werror
Stéphane Raimbault 14 жил өмнө
parent
commit
cfe875e72e

+ 15 - 0
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

+ 0 - 1
tests/bandwidth-server-many-up.c

@@ -28,7 +28,6 @@
 #include <ws2tcpip.h>
 #else
 #include <netinet/in.h>
-/* Required by inet_ntoa() to avoid a segfault! */
 #include <arpa/inet.h>
 #endif