summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d0b051)
raw | patch | inline | side by side (parent: 3d0b051)
author | Junio C Hamano <gitster@pobox.com> | |
Thu, 15 Dec 2011 18:10:11 +0000 (10:10 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 15 Dec 2011 18:10:11 +0000 (10:10 -0800) |
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 <gitster@pobox.com>
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 <gitster@pobox.com>
builtin/checkout.c | patch | blob | history |
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 31aa248c0e8f2bdba8a6c666dd8a4c2a62b63c3f..064e7a14c130419c355bb209ca4336130d24187f 100644 (file)
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
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) {