{"thread":{"id":"27216","subject":"[PATCH] avoid set-but-not-used warning","startedAt":"2011-04-29T09:42:41Z","lastAt":"2011-04-29T16:43:54Z","messageCount":4,"participants":["Jim Meyering","Junio C Hamano","Thiago Farina"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"166725","messageId":"874o5hv1f2.fsf@rho.meyering.net","threadId":"27216","inReplyTo":null,"subject":"[PATCH] avoid set-but-not-used warning","fromName":"Jim Meyering","fromEmail":"jim@meyering.net","sentAt":"2011-04-29T09:42:41Z","receivedAt":"2011-04-29T09:42:41Z","isPatch":true,"sender":{"key":"jim@meyering.net","avatar":"https://avatars.githubusercontent.com/u/710630?v=4"},"body":"I noticed this on master (also applies to next), compiling with gcc-4.6:\n\n    diffcore-rename.c: In function 'diffcore_rename':\n    diffcore-rename.c:501:18: warning: variable 'num_src' set but not used \\\n      [-Wunused-but-set-variable]\n\nHere's the fix:\n\n-- >8 --\nSubject: [PATCH] avoid set-but-not-used warning\n\n* diffcore-rename.c (diffcore_rename): Remove declaration and set.\n\nSigned-off-by: Jim Meyering <meyering@redhat.com>\n---\n diffcore-rename.c |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/diffcore-rename.c b/diffcore-rename.c\nindex f62587e..3d65bb3 100644\n--- a/diffcore-rename.c\n+++ b/diffcore-rename.c\n@@ -498,7 +498,7 @@ void diffcore_rename(struct diff_options *options)\n \tstruct diff_queue_struct outq;\n \tstruct diff_score *mx;\n \tint i, j, rename_count, skip_unmodified = 0;\n-\tint num_create, num_src, dst_cnt;\n+\tint num_create, dst_cnt;\n \tstruct progress *progress = NULL;\n\n \tif (!minimum_score)\n@@ -554,7 +554,6 @@ void diffcore_rename(struct diff_options *options)\n \t * files still remain as options for rename/copies!)\n \t */\n \tnum_create = (rename_dst_nr - rename_count);\n-\tnum_src = rename_src_nr;\n\n \t/* All done? */\n \tif (!num_create)\n--\n1.7.5.452.gcf2d0\n"},{"id":"166747","messageId":"7vwridxbs9.fsf@alter.siamese.dyndns.org","threadId":"27216","inReplyTo":"874o5hv1f2.fsf@rho.meyering.net","subject":"Re: [PATCH] avoid set-but-not-used warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-29T16:28:06Z","receivedAt":"2011-04-29T16:28:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"},{"id":"166752","messageId":"BANLkTi=KZxTrAzoj3Bhwr3XTEPNnOvcvdQ@mail.gmail.com","threadId":"27216","inReplyTo":"7vwridxbs9.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] avoid set-but-not-used warning","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2011-04-29T16:34:25Z","receivedAt":"2011-04-29T16:34:25Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"On Fri, Apr 29, 2011 at 1:28 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Thanks.\n\nIngo Molnar has posted the same fix in \"diffcore-rename: Remove unused\nvariable 'num_src'\".\n\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"166753","messageId":"7vzkn9vwhh.fsf@alter.siamese.dyndns.org","threadId":"27216","inReplyTo":"BANLkTi=KZxTrAzoj3Bhwr3XTEPNnOvcvdQ@mail.gmail.com","subject":"Re: [PATCH] avoid set-but-not-used warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-29T16:43:54Z","receivedAt":"2011-04-29T16:43:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thiago Farina <tfransosi@gmail.com> writes:\n\n> On Fri, Apr 29, 2011 at 1:28 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Thanks.\n>\n> Ingo Molnar has posted the same fix in \"diffcore-rename: Remove unused\n> variable 'num_src'\".\n\nWhat do you want _me_ to do about that?\n\nIf this were addressed to Jim I may kind-of understand what you were\ntrying to say, but you addressed me, and I am puzzled.\n"}]}