From: Junio C Hamano Date: Thu, 15 Dec 2011 18:10:11 +0000 (-0800) Subject: checkout_merged(): squelch false warning from some gcc X-Git-Tag: v1.7.8.2~3^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=335c6e403d862913846661638af6e184055f6db5;p=git.git checkout_merged(): squelch false warning from some gcc gcc 4.6.2 (there may be others) does not realize that the variable "mode" can never be used uninitialized in this function and issues a false warning under -Wuninitialized option. Squelch it with an unnecessary initialization; it is not like a single assignment matters to the performance in this codepath that writes out to the filesystem with checkout_entry() anyway. Signed-off-by: Junio C Hamano --- diff --git a/builtin/checkout.c b/builtin/checkout.c index 31aa248c0..064e7a14c 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -152,7 +152,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 = 0; memset(threeway, 0, sizeof(threeway)); while (pos < active_nr) {