From: Ken Raeburn Date: Thu, 23 Aug 2007 07:11:21 +0000 (+0000) Subject: Use -Wno-format-zero-length if GCC version supports it X-Git-Tag: krb5-1.7-alpha1~950 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1ba85a1abdc293f48583f136bc3a6d60025bca69;p=krb5.git Use -Wno-format-zero-length if GCC version supports it git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19848 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 8cdbc4788..f29446a1f 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -625,6 +625,19 @@ if test "$GCC" = yes ; then else CFLAGS="$CFLAGS -pedantic" fi + AC_CACHE_CHECK([if GCC supports -Wno-format-zero-length], + krb5_cv_gcc_Wno_format_zero_length, + [# first try without, then with + AC_TRY_COMPILE([], 1;, + [old_cflags="$CFLAGS" + CFLAGS="$CFLAGS -Wno-format-zero-length" + AC_TRY_COMPILE([], 1;, krb5_cv_gcc_Wno_format_zero_length=yes, + krb5_cv_gcc_Wno_format_zero_length=no) + CFLAGS="$old_cflags"], + [AC_MSG_ERROR(compiling simple test program with $CFLAGS failed)])]) + if test "$krb5_cv_gcc_Wno_format_zero_length" = yes; then + CFLAGS="$CFLAGS -Wno-format-zero-length" + fi fi if test "`uname -s`" = Darwin ; then # Someday this should be a feature test.