remote-curl.c: Fix a compiler warning
PATCH 1/1 remote-curl.c: Fix a compiler warning
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.
---
Hi Junio,
This is on top of next. (commit df126e108: "remote-curl: hoist gzip buffer size to top of post_rpc", 31-10-2012).
Thanks!
ATB,
Ramsay Jones
remote-curl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
remote-curl.c +1 -1
@@ -400,7 +400,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
Signature · 1 line
1.8.0
Quoted 6 lines · Ramsay Jones
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.
Quoted 7 lines
Signed-off-by Ramsay Jones <[email protected]>---
Hi Junio,
This is on top of next. (commit
df126e108: "remote-curl: hoist gzip buffer size to top ofpost_rpc", 31-10-2012).
Thanks. I meant to apply this during my tenure as maintainer, but it slipped through the cracks.
-Peff