summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2013-07-30 18:22:48 +0200
committerAnand Avati <avati@redhat.com>2013-07-30 20:34:53 -0700
commit7e6432015afd758ca3fd9e32d3e62b29935b0874 (patch)
tree05e80442c9dd636fa80a94dfcd3409eecec0507e
parent0bbdfa3d403a90fa0f30e0e5bd56644c875c12c1 (diff)
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 <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/5435 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0aefdd283cc..70cc7fd9fca 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