summaryrefslogtreecommitdiffstats
path: root/src/aclocal.m4
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2010-10-02 03:29:34 +0000
committerKen Raeburn <raeburn@mit.edu>2010-10-02 03:29:34 +0000
commit4e51cc948504a97a7074ff406f5f834287b76f7b (patch)
tree0f9ac04b2c6712e2eb5d6e5d0b9122311bcdcbdf /src/aclocal.m4
parentf938444f01826c14d5ddc49d4a9f392a8049b0c8 (diff)
downloadkrb5-4e51cc948504a97a7074ff406f5f834287b76f7b.tar.gz
krb5-4e51cc948504a97a7074ff406f5f834287b76f7b.tar.xz
krb5-4e51cc948504a97a7074ff406f5f834287b76f7b.zip
Try to require function declarations for GCC, as we already do for the
Sun compiler. Change the cache variable name construction to distinguish "=" from "-" in option names. Prefer -Werror-implicit-function-declaration over -Werror=implicit-function-declaration since in some versions of GCC only the former works properly. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24409 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/aclocal.m4')
-rw-r--r--src/aclocal.m414
1 files changed, 12 insertions, 2 deletions
diff --git a/src/aclocal.m4 b/src/aclocal.m4
index 5637f6870f..408035aaeb 100644
--- a/src/aclocal.m4
+++ b/src/aclocal.m4
@@ -466,7 +466,7 @@ krb5_ac_warn_cxxflags_set=${WARN_CXXFLAGS+set}
])
dnl
AC_DEFUN(TRY_WARN_CC_FLAG,[dnl
- cachevar=`echo "krb5_cv_cc_flag_$1" | sed s/[[^a-zA-Z0-9_]]/_/g`
+ cachevar=`echo "krb5_cv_cc_flag_$1" | sed -e s/=/_eq_/g -e s/-/_dash_/g -e s/[[^a-zA-Z0-9_]]/_/g`
AC_CACHE_CHECK([if C compiler supports $1], [$cachevar],
[# first try without, then with
AC_TRY_COMPILE([], 1;,
@@ -565,7 +565,17 @@ if test "$GCC" = yes ; then
TRY_WARN_CC_FLAG(-W$flag)
fi
done
- # missing-prototypes? maybe someday
+ # We require function declarations now.
+ #
+ # In some compiler versions -- e.g., "gcc version 4.2.1 (Apple
+ # Inc. build 5664)" -- the -Werror- option works, but the -Werror=
+ # version doesn't cause implicitly declared functions to be
+ # flagged as errors. If neither works, -Wall implies
+ # -Wimplicit-function-declaration so don't bother.
+ TRY_WARN_CC_FLAG(-Werror-implicit-function-declaration)
+ if test "implicit-function-declaration_supported" = no; then
+ TRY_WARN_CC_FLAG(-Werror=implicit-function-declaration)
+ fi
#
fi
if test "`uname -s`" = Darwin ; then