Skip to content

Commit

Permalink
remote-curl.c: Fix a compiler warning
Browse files Browse the repository at this point in the history
In particular, gcc issues an "'gzip_size' might be used uninitialized"
warning (-Wuninitialized). However, this warning is a false positive,
since the 'gzip_size' variable would not, in fact, be used uninitialized.
In order to suppress the warning, we simply initialise the variable to
zero in it's declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramsay Jones authored and Junio C Hamano committed Nov 21, 2012
1 parent 2e736fd commit 3771154
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion remote-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ static int post_rpc(struct rpc_state *rpc)
struct curl_slist *headers = NULL;
int use_gzip = rpc->gzip_request;
char *gzip_body = NULL;
size_t gzip_size;
size_t gzip_size = 0;
int err, large_request = 0;

/* Try to load the entire request, if we can fit it into the
Expand Down

0 comments on commit 3771154

Please sign in to comment.