All of lore.kernel.org
 help / color / mirror / Atom feed
From: dsp@php.net
To: git@vger.kernel.org
Cc: David Soria Parra <dsp@php.net>
Subject: [PATCH] checkout: squelch "'mode' may be used uninitialized in this function" warning
Date: Tue,  1 May 2012 00:39:27 +0200	[thread overview]
Message-ID: <1335825567-7831-1-git-send-email-dsp@php.net> (raw)

From: David Soria Parra <dsp@php.net>

Use a 'fake' initialization for the 'mode' variable to work around a
GCC warning as in 5a7a367. The necessary condition to initialize 'mode'
will always be true but cannot be checked by the compiler.

Signed-off-by: David Soria Parra <dsp@php.net>
---
 builtin/checkout.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 84d3eb3..6b8bf31 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -157,7 +157,7 @@ static int checkout_merged(int pos, struct checkout *state)
 	unsigned char sha1[20];
 	mmbuffer_t result_buf;
 	unsigned char threeway[3][20];
-	unsigned mode;
+	unsigned mode = mode;
 
 	memset(threeway, 0, sizeof(threeway));
 	while (pos < active_nr) {
-- 
1.7.8.GIT

             reply	other threads:[~2012-04-30 22:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30 22:39 dsp [this message]
2012-05-03 10:59 ` [PATCH] checkout: squelch "'mode' may be used uninitialized in this function" warning David Soria Parra
2012-05-08 20:26   ` 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=1335825567-7831-1-git-send-email-dsp@php.net \
    --to=dsp@php.net \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.