{"thread":{"id":"32158","subject":"[PATCH] remote-curl.c: Fix a compiler warning","startedAt":"2012-11-21T19:08:51Z","lastAt":"2012-11-21T19:34:53Z","messageCount":2,"participants":["Ramsay Jones","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"203613","messageId":"50AD26C3.2090407@ramsay1.demon.co.uk","threadId":"32158","inReplyTo":null,"subject":"[PATCH] remote-curl.c: Fix a compiler warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-11-21T19:08:51Z","receivedAt":"2012-11-21T19:08:51Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"In particular, gcc issues an \"'gzip_size' might be used uninitialized\"\nwarning (-Wuninitialized). However, this warning is a false positive,\nsince the 'gzip_size' variable would not, in fact, be used uninitialized.\nIn order to suppress the warning, we simply initialise the variable to\nzero in it's declaration.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Junio,\n\nThis is on top of next. (commit df126e108: \"remote-curl: hoist gzip\nbuffer size to top of post_rpc\", 31-10-2012).\n\nThanks!\n\nATB,\nRamsay Jones\n\n remote-curl.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/remote-curl.c b/remote-curl.c\nindex d8b3600..9a8b123 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -400,7 +400,7 @@ static int post_rpc(struct rpc_state *rpc)\n \tstruct curl_slist *headers = NULL;\n \tint use_gzip = rpc->gzip_request;\n \tchar *gzip_body = NULL;\n-\tsize_t gzip_size;\n+\tsize_t gzip_size = 0;\n \tint err, large_request = 0;\n \n \t/* Try to load the entire request, if we can fit it into the\n-- \n1.8.0\n"},{"id":"203620","messageId":"20121121193453.GD16280@sigill.intra.peff.net","threadId":"32158","inReplyTo":"50AD26C3.2090407@ramsay1.demon.co.uk","subject":"Re: [PATCH] remote-curl.c: Fix a compiler warning","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-11-21T19:34:53Z","receivedAt":"2012-11-21T19:34:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Nov 21, 2012 at 07:08:51PM +0000, Ramsay Jones wrote:\n\n> In particular, gcc issues an \"'gzip_size' might be used uninitialized\"\n> warning (-Wuninitialized). However, this warning is a false positive,\n> since the 'gzip_size' variable would not, in fact, be used uninitialized.\n> In order to suppress the warning, we simply initialise the variable to\n> zero in it's declaration.\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n> \n> Hi Junio,\n> \n> This is on top of next. (commit df126e108: \"remote-curl: hoist gzip\n> buffer size to top of post_rpc\", 31-10-2012).\n\nThanks. I meant to apply this during my tenure as maintainer, but it\nslipped through the cracks.\n\n-Peff\n"}]}