git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: kusmabite@gmail.com
Cc: Frank Li <lznuaa@gmail.com>, git@vger.kernel.org
Subject: Re: possible code error at run_command.c
Date: Mon, 21 Dec 2009 09:52:02 +0100	[thread overview]
Message-ID: <4B2F3732.6030903@viscovery.net> (raw)
In-Reply-To: <40aa078e0912210041g1fd94c77g6cf9f1b236b6ecd7@mail.gmail.com>

Erik Faye-Lund schrieb:
> On Mon, Dec 21, 2009 at 9:30 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
>> Frank Li schrieb:
>>> Maybe some excute path miss initialized it. Otherwise compiler will
>>> not report warning.
>> LOOK AT THE CODE. There is no such code path.
>>
> 
> That's odd.

Only if Frank did the homework and removed the initialization from

	int failed_errno = failed_errno;

> I agree, there isn't such a code path. But this is the
> first time I've ever seen this MSVC-feature turn up false positives,
> which puzzles me.

This line will trigger the check. It initializes failed_errno with itself,
which is still uninitialized at this time.

Note that we have more definitions of this kind:

$ git grep -E ' ([a-zA-Z_][a-zA-Z_0-9]*) = \1[;,]' *.c
builtin-rev-list.c:             int reaches = reaches, all = all;
match-trees.c:          unsigned mode1 = mode1;
match-trees.c:          unsigned mode2 = mode2;
run-command.c:  int failed_errno = failed_errno;
transport.c:            int cmp = cmp, len;
wt-status.c:    int status = status;

-- Hannes

  reply	other threads:[~2009-12-21  8:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21  6:46 possible code error at run_command.c Frank Li
2009-12-21  7:09 ` Wincent Colaiuta
2009-12-21  7:18 ` Johannes Sixt
2009-12-21  7:29   ` Frank Li
2009-12-21  7:43     ` Johannes Sixt
2009-12-21  8:18       ` Frank Li
2009-12-21  8:30         ` Johannes Sixt
2009-12-21  8:41           ` Erik Faye-Lund
2009-12-21  8:52             ` Johannes Sixt [this message]
2009-12-21  9:08               ` Erik Faye-Lund
2009-12-21  9:13               ` Frank Li

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=4B2F3732.6030903@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=kusmabite@gmail.com \
    --cc=lznuaa@gmail.com \
    /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).