Skip to content

Commit 335c6e4

Browse files
committed
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 <[email protected]>
1 parent 3d0b051 commit 335c6e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static int checkout_merged(int pos, struct checkout *state)
152152
unsigned char sha1[20];
153153
mmbuffer_t result_buf;
154154
unsigned char threeway[3][20];
155-
unsigned mode;
155+
unsigned mode = 0;
156156

157157
memset(threeway, 0, sizeof(threeway));
158158
while (pos < active_nr) {

0 commit comments

Comments
 (0)