From: Greg Hudson Date: Mon, 3 Nov 2014 22:27:00 +0000 (-0500) Subject: Fix spurious gcc warning in cc_file.c X-Git-Tag: krb5-1.14-alpha1~209 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35ab0d013f35a9840d0fbcb8de3b194eb501199d;p=thirdparty%2Fkrb5.git Fix spurious gcc warning in cc_file.c gcc 4.6.3 (present in Ubuntu 12.04) is smart enough to look at get_size and see that it does not always assign to *size_out, but not smart enough to figure out that it always assigns to *size_out when it returns 0. As a result, it outputs two warnings which we treat as errors. Add an initial assignment to *size_out at the beginning of get_size to work around this. ticket: 8026 --- diff --git a/src/lib/krb5/ccache/cc_file.c b/src/lib/krb5/ccache/cc_file.c index e94b5bb783..cd6fb9dbc7 100644 --- a/src/lib/krb5/ccache/cc_file.c +++ b/src/lib/krb5/ccache/cc_file.c @@ -119,6 +119,7 @@ get_size(krb5_context context, FILE *fp, size_t *size_out) { struct stat sb; + *size_out = 0; if (fstat(fileno(fp), &sb) == -1) return interpret_errno(context, errno); if (sizeof(off_t) > sizeof(size_t) && sb.st_size > (off_t)SIZE_MAX)