git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH 1/2] fast-import: Fix an gcc -Wuninitialized warning
Date: Thu, 28 Mar 2013 18:20:29 +0000	[thread overview]
Message-ID: <515489ED.7070109@ramsay1.demon.co.uk> (raw)
In-Reply-To: <20130326192822.GA28244@sigill.intra.peff.net>

Jeff King wrote:
> On Tue, Mar 26, 2013 at 07:09:44PM +0000, Ramsay Jones wrote:
> 
>> Commit cbfd5e1c ("drop some obsolete "x = x" compiler warning hacks",
>> 21-03-2013) removed a gcc hack that suppressed an "might be used
>> uninitialized" warning issued by older versions of gcc.
>>
>> However, commit 3aa99df8 ('fast-import: clarify "inline" logic in
>> file_change_m', 21-03-2013) addresses an (almost) identical issue
>> (with very similar code), but includes additional code in it's
>> resolution. The solution used by this commit, unlike that used by
>> commit cbfd5e1c, also suppresses the -Wuninitialized warning on
>> older versions of gcc.
>>
>> In order to suppress the warning (against the 'oe' symbol) in the
>> note_change_n() function, we adopt the same solution used by commit
>> 3aa99df8.
> 
> Yeah, they are essentially the same piece of code, so I don't mind this
> change.  It is odd to me that gcc gets it right in one case but not the
> other, but I think we are deep into the vagaries of the compiler's code
> flow analysis here, and we cannot make too many assumptions.
> 
> Were you actually triggering this warning, and if so, on what version of
> gcc? 

yes, with:
    gcc v3.4.4 (cygwin)
    gcc v4.1.2 (Linux)
    msvc v15.00.30729.01 (VC/C++ 2008 express edition)
no, with:
    gcc v4.4.0 (msysgit)
    clang 3.2 (Linux)
    tcc v0.9.26 (Linux)
[lcc can't compile git; I forget why exactly.]

>       Or did the asymmetry just offend your sensibilities?

My sensibilities were, indeed, very offended! ;-)

ATB,
Ramsay Jones

  reply	other threads:[~2013-03-28 18:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 19:09 [PATCH 1/2] fast-import: Fix an gcc -Wuninitialized warning Ramsay Jones
2013-03-26 19:28 ` Jeff King
2013-03-28 18:20   ` Ramsay Jones [this message]
2013-03-28 18:53     ` Jeff King

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=515489ED.7070109@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1.demon.co.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).