[28642] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Fix spurious gcc warning in cc_file.c

daemon@ATHENA.MIT.EDU (Greg Hudson)
Mon Nov 3 17:37:50 2014

Date: Mon, 3 Nov 2014 17:37:46 -0500
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201411032237.sA3MbkJm002447@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/35ab0d013f35a9840d0fbcb8de3b194eb501199d
commit 35ab0d013f35a9840d0fbcb8de3b194eb501199d
Author: Greg Hudson <ghudson@mit.edu>
Date:   Mon Nov 3 17:27:00 2014 -0500

    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

 src/lib/krb5/ccache/cc_file.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/lib/krb5/ccache/cc_file.c b/src/lib/krb5/ccache/cc_file.c
index e94b5bb..cd6fb9d 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)
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post