public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1•demon.co.uk>
To: Thomas Gummerer <t.gummerer@gmail•com>
Cc: GIT Mailing-list <git@vger•kernel.org>
Subject: Re: read-cache-v5.c: compiler warnings
Date: Tue, 21 Aug 2012 20:04:41 +0100	[thread overview]
Message-ID: <5033DBC9.7010707@ramsay1.demon.co.uk> (raw)
In-Reply-To: <20120820082854.GA10909@tommy-fedora>

Thomas Gummerer wrote:
> 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.

You would hope that was true, but I would not bet on it! I've seen these types
of warnings (which rely heavily on analysis performed primarily for optimisation)
come and go several times in gcc.

> 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.

Thanks!

ATB,
Ramsay Jones

      reply	other threads:[~2012-08-21 19:07 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
2012-08-21 19:04   ` Ramsay Jones [this message]

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=5033DBC9.7010707@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1$(echo .)demon.co.uk \
    --cc=git@vger$(echo .)kernel.org \
    --cc=t.gummerer@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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