Skip to content

Commit

Permalink
transport.c: help gcc 4.6.3 users by squelching compiler warning
Browse files Browse the repository at this point in the history
To a human reader, it is quite obvious that cmp is assigned before
it is used, but gcc 4.6.3 that ships with Ubuntu 12.04 is among
those that do not get this right.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Mar 25, 2013
1 parent c9fc441 commit 04fe118
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
return;

for (;;) {
int cmp, len;
int cmp = 0; /* assigned before used */
int len;

if (!fgets(buffer, sizeof(buffer), f)) {
fclose(f);
Expand Down

0 comments on commit 04fe118

Please sign in to comment.