svn rev #24409: trunk/src/
raeburn@MIT.EDU
raeburn at MIT.EDU
Fri Oct 1 23:29:34 EDT 2010
http://src.mit.edu/fisheye/changelog/krb5/?cs=24409
Commit By: raeburn
Log Message:
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.
Changed Files:
U trunk/src/aclocal.m4
Modified: trunk/src/aclocal.m4
===================================================================
--- trunk/src/aclocal.m4 2010-10-02 02:43:46 UTC (rev 24408)
+++ trunk/src/aclocal.m4 2010-10-02 03:29:34 UTC (rev 24409)
@@ -466,7 +466,7 @@
])
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,8 +565,18 @@
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
# Someday this should be a feature test.
More information about the cvs-krb5
mailing list