{"thread":{"id":"22227","subject":"[PATCH 2/2] Fix variable initialization in insert_packed_refs().","startedAt":"2010-01-14T23:29:01Z","lastAt":"2010-01-15T11:02:38Z","messageCount":3,"participants":["Richard Weinberger","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"131690","messageId":"201001150029.01486.richard@nod.at","threadId":"22227","inReplyTo":null,"subject":"[PATCH 2/2] Fix variable initialization in insert_packed_refs().","fromName":"Richard Weinberger","fromEmail":"richard@nod.at","sentAt":"2010-01-14T23:29:01Z","receivedAt":"2010-01-14T23:29:01Z","isPatch":true,"sender":{"key":"richard@nod.at","avatar":"https://avatars.githubusercontent.com/u/1149549?v=4"},"body":"Signed-off-by: Richard Weinberger <richard@nod.at>\n---\n transport.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/transport.c b/transport.c\nindex 3b489b3..ecc20a1 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -102,7 +102,7 @@ static void insert_packed_refs(const char *packed_refs, \nstruct ref **list)\n \t\treturn;\n \n \tfor (;;) {\n-\t\tint cmp = cmp, len;\n+\t\tint cmp, len;\n \n \t\tif (!fgets(buffer, sizeof(buffer), f)) {\n \t\t\tfclose(f);\n-- \n1.6.5.7\n"},{"id":"131708","messageId":"4B501A9D.6060703@viscovery.net","threadId":"22227","inReplyTo":"201001150029.01486.richard@nod.at","subject":"Re: [PATCH 2/2] Fix variable initialization in insert_packed_refs().","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-01-15T07:34:53Z","receivedAt":"2010-01-15T07:34:53Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Richard Weinberger schrieb:\n> -\t\tint cmp = cmp, len;\n> +\t\tint cmp, len;\n\nIf you look around in the code, you'll find more *cough* initializations\n*cough* like this. They are written this way for a reason: they avoid\nunwarranted compiler warnings \"'foo' may be used uninitialized\". Are you\nsaying that this warning is not triggered anymore after your change?\n\n-- Hannes\n"},{"id":"131714","messageId":"201001151202.38762.richard@nod.at","threadId":"22227","inReplyTo":"4B501A9D.6060703@viscovery.net","subject":"Re: [PATCH 2/2] Fix variable initialization in insert_packed_refs().","fromName":"Richard Weinberger","fromEmail":"richard@nod.at","sentAt":"2010-01-15T11:02:38Z","receivedAt":"2010-01-15T11:02:38Z","isPatch":true,"sender":{"key":"richard@nod.at","avatar":"https://avatars.githubusercontent.com/u/1149549?v=4"},"body":"Am Freitag 15 Januar 2010 08:34:53 schrieb Johannes Sixt:\n> If you look around in the code, you'll find more *cough* initializations\n> *cough* like this. They are written this way for a reason: they avoid\n> unwarranted compiler warnings \"'foo' may be used uninitialized\". Are you\n> saying that this warning is not triggered anymore after your change?\n> \n\nI don't get a warning after my change. \nBut I'm using on this system a quite old gcc (4.3.1).\nI'll recompile git with a more recent gcc and see what happens.\n\nJust for clarification:\n\"int cmp = cmp;\"\n*suppresses* only the warning but \"cmp\" is still uninitialized?\n(I did'nt know this trick before.)\n\n//richard\n"}]}