{"thread":{"id":"8522","subject":"[RFC][PATCH 10/10] Sparse: fix a \"symbol 'weak_match' shadows an earlier one\" warning","startedAt":"2007-06-08T22:27:08Z","lastAt":"2007-06-12T17:43:25Z","messageCount":3,"participants":["Ramsay Jones","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":10},"messages":[{"id":"44429","messageId":"4669D7BC.3060607@ramsay1.demon.co.uk","threadId":"8522","inReplyTo":null,"subject":"[RFC][PATCH 10/10] Sparse: fix a \"symbol 'weak_match' shadows an earlier one\" warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2007-06-08T22:27:08Z","receivedAt":"2007-06-08T22:27:08Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n connect.c |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/connect.c b/connect.c\nindex da89c9c..d4051dd 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -179,7 +179,6 @@ static int count_refspec_match(const char *pattern,\n \tfor (weak_match = match = 0; refs; refs = refs->next) {\n \t\tchar *name = refs->name;\n \t\tint namelen = strlen(name);\n-\t\tint weak_match;\n \n \t\tif (namelen < patlen ||\n \t\t    memcmp(name + namelen - patlen, pattern, patlen))\n-- \n1.5.2\n"},{"id":"44435","messageId":"7vr6olh7pb.fsf@assigned-by-dhcp.cox.net","threadId":"8522","inReplyTo":"4669D7BC.3060607@ramsay1.demon.co.uk","subject":"Re: [RFC][PATCH 10/10] Sparse: fix a \"symbol 'weak_match' shadows an earlier one\" warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-09T08:07:28Z","receivedAt":"2007-06-09T08:07:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n>  connect.c |    1 -\n>  1 files changed, 0 insertions(+), 1 deletions(-)\n>\n> diff --git a/connect.c b/connect.c\n> index da89c9c..d4051dd 100644\n> --- a/connect.c\n> +++ b/connect.c\n> @@ -179,7 +179,6 @@ static int count_refspec_match(const char *pattern,\n>  \tfor (weak_match = match = 0; refs; refs = refs->next) {\n>  \t\tchar *name = refs->name;\n>  \t\tint namelen = strlen(name);\n> -\t\tint weak_match;\n>  \n>  \t\tif (namelen < patlen ||\n>  \t\t    memcmp(name + namelen - patlen, pattern, patlen))\n\nThis one is an obvious bug.  Essentially, it makes weak matches\nignored.  Unfortunately this has been hiding a larger bug in the\ncaller of this function.  I am refactoring the mess right now.\n"},{"id":"44851","messageId":"466EDB3D.4070302@ramsay1.demon.co.uk","threadId":"8522","inReplyTo":"7vr6olh7pb.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFC][PATCH 10/10] Sparse: fix a \"symbol 'weak_match' shadows an earlier one\" warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2007-06-12T17:43:25Z","receivedAt":"2007-06-12T17:43:25Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n> \n>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>> ---\n>>  connect.c |    1 -\n>>  1 files changed, 0 insertions(+), 1 deletions(-)\n>>\n>> diff --git a/connect.c b/connect.c\n>> index da89c9c..d4051dd 100644\n>> --- a/connect.c\n>> +++ b/connect.c\n>> @@ -179,7 +179,6 @@ static int count_refspec_match(const char *pattern,\n>>  \tfor (weak_match = match = 0; refs; refs = refs->next) {\n>>  \t\tchar *name = refs->name;\n>>  \t\tint namelen = strlen(name);\n>> -\t\tint weak_match;\n>>  \n>>  \t\tif (namelen < patlen ||\n>>  \t\t    memcmp(name + namelen - patlen, pattern, patlen))\n> \n> This one is an obvious bug.  \n\nIndeed ;-)\nAlso, I'm guessing it does not bring your machine down like a house of cards.\n\n... Essentially, it makes weak matches\n> ignored.  Unfortunately this has been hiding a larger bug in the\n> caller of this function.  I am refactoring the mess right now.\n> \nGreat. Hopefully it will also address the cygwin issue.\n\nATB\n\nRamsay Jones\n"}]}