From 7e6432015afd758ca3fd9e32d3e62b29935b0874 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 30 Jul 2013 18:22:48 +0200 Subject: build: use -Werror=implicit-function-declaration to detect build issues There have been review requests that include a call to a non-existent function. These problems should be detected as early as possible, preferably before (automated) regression tests. Bug: 990243 Change-Id: Idcf4d27f45a1a6177105d02a039363702eb8e3b9 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/5435 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System Reviewed-by: Anand Avati --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 0aefdd28..70cc7fd9 100644 --- a/configure.ac +++ b/configure.ac @@ -594,6 +594,18 @@ else CFLAGS="$saved_CFLAGS $CFLAGS" fi +# check for gcc -Werror=implicit-function-declaration +saved_CFLAGS=$CFLAGS +CFLAGS="-Werror=implicit-function-declaration" +AC_MSG_CHECKING([whether $CC accepts -Werror=implicit-function-declaration]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_implicit=yes], [cc_werror_implicit=no]) +echo $cc_werror_implicit +if test "x$cc_werror_implicit" = "xno"; then + CFLAGS="$saved_CFLAGS" +else + CFLAGS="$saved_CFLAGS $CFLAGS" +fi + case $host_os in linux*) dnl GF_LINUX_HOST_OS=1 -- cgit