git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkout: squelch "'mode' may be used uninitialized in this function" warning
@ 2012-04-30 22:39 dsp
  2012-05-03 10:59 ` David Soria Parra
  0 siblings, 1 reply; 3+ messages in thread
From: dsp @ 2012-04-30 22:39 UTC (permalink / raw)
  To: git; +Cc: David Soria Parra

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-08 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30 22:39 [PATCH] checkout: squelch "'mode' may be used uninitialized in this function" warning dsp
2012-05-03 10:59 ` David Soria Parra
2012-05-08 20:26   ` Jeff King

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