Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] Avoid gcc compiler warning
Date: Tue, 9 Dec 2014 03:47:28 -0500	[thread overview]
Message-ID: <20141209084728.GA13123@peff.net> (raw)
In-Reply-To: <b9e1cb1f858e71b964be4f752fcebc22cd944ebc.1418056722.git.johannes.schindelin@gmx.de>

On Mon, Dec 08, 2014 at 05:38:59PM +0100, Johannes Schindelin wrote:

> At least on this developer's MacOSX (Snow Leopard, gcc-4.2.1), GCC prints
> a warning that 'hash' may be used uninitialized when compiling
> test-hashmap that 'hash' may be used uninitialized (but GCC 4.6.3 on this
> developer's Ubuntu server does not report this problem).
> 
> Since hash() is called from perf_hashmap() which accepts an unchecked
> integer value from the command line, the warning appears to be legitimate,
> even if the test-hashmap command is only called from the test suite.

I think the older gcc is wrong; we are switching on "method & 3", which
must be in the range 0-3 (and we cover all cases).

I do not mind silencing the warning anyway, but see this discussion:

  http://thread.gmane.org/gmane.comp.version-control.git/258186

The thread seems very broken in gmane, but it continues here:

  http://article.gmane.org/gmane.comp.version-control.git/258232

  http://thread.gmane.org/gmane.comp.version-control.git/258245

  http://article.gmane.org/gmane.comp.version-control.git/258264

-Peff

  reply	other threads:[~2014-12-09  8:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1418056722.git.johannes.schindelin@gmx.de>
2014-12-08 16:38 ` [PATCH] Avoid gcc compiler warning Johannes Schindelin
2014-12-09  8:47   ` Jeff King [this message]
2014-12-09  9:48     ` Johannes Schindelin

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=20141209084728.GA13123@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    /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