From ef397081cdfde72f6c14b14ee73a371544fb2b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sat, 7 Oct 2006 17:31:56 +0000 Subject: [PATCH] memset the structure to make sure that we don't get compiler warnings. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18314 ec53bebd-3082-4978-b11e-865c3cabbd6b --- cf/have-struct-field.m4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cf/have-struct-field.m4 b/cf/have-struct-field.m4 index 25342de75..bb7bcefbc 100644 --- a/cf/have-struct-field.m4 +++ b/cf/have-struct-field.m4 @@ -7,9 +7,11 @@ dnl AC_HAVE_STRUCT_FIELD(struct, field, headers) AC_DEFUN([AC_HAVE_STRUCT_FIELD], [ define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_])) AC_CACHE_CHECK([for $2 in $1], cache_val,[ -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$3]],[[$1 x; x.$2]])], -[cache_val=yes], -[cache_val=no])]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$3]], + [[$1 x; memset(&x, 0, sizeof(x)); x.$2]])], + [cache_val=yes], + [cache_val=no]) +]) if test "$cache_val" = yes; then define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_])) AC_DEFINE(foo, 1, [Define if $1 has field $2.])