git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gummerer <t.gummerer@gmail.com>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: Re: read-cache-v5.c: compiler warnings
Date: Mon, 20 Aug 2012 10:29:34 +0200	[thread overview]
Message-ID: <20120820082854.GA10909@tommy-fedora> (raw)
In-Reply-To: <50313AEC.1060700@ramsay1.demon.co.uk>

On 08/19, Ramsay Jones wrote:
> Hi Thomas,
> 
> Just an FYI; two out of the three gcc compilers I use (Linux, cygwin
> but not MingW), issue the following warnings:
> 
>         CC read-cache-v5.o
>     read-cache-v5.c: In function `write_index_v5':
>     read-cache-v5.c:1011: warning: 'dir' might be used uninitialized in this function
>     read-cache-v5.c:1012: warning: 'search' might be used uninitialized in this function
>     read-cache-v5.c:1012: warning: 'found' might be used uninitialized in this function
> 
> [commit d2537158 ("Write index-v5", 16-08-2012)]
> 
> Normally I would take a look and offer a patch, but I haven't found time
> to do so in the last 10 days. So, I'm just giving you a heads up ... ;-P

Thanks for noticing.  This warnings only seem to be issued by older
versions of gcc, which is probably why two compilers give the warnings
while one doesn't.

The variables can never be uninitialized, because they are guarded by
ifs and older versions don't seem to recognize that.  I'll fix them
in a re-roll though (or a separate patch if that's preferred), just
waiting for some feedback for v4 of my series.

> 
> HTH
> 
> ATB,
> Ramsay Jones
> 

Thomas

  reply	other threads:[~2012-08-20  8:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-19 19:13 read-cache-v5.c: compiler warnings Ramsay Jones
2012-08-20  8:29 ` Thomas Gummerer [this message]
2012-08-21 19:04   ` Ramsay Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120820082854.GA10909@tommy-fedora \
    --to=t.gummerer@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ramsay@ramsay1.demon.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).