Re: [RFC][PATCH 10/10] Sparse: fix a "symbol 'weak_match' shadows an earlier one" warning

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFC][PATCH 10/10] Sparse: fix a "symbol 'weak_match' shadows an earlier one" warning

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:15

Ramsay Jones [off-list ref] writes:
quoted hunk
Signed-off-by: Ramsay Jones <redacted>
---
 connect.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/connect.c b/connect.c
index da89c9c..d4051dd 100644
--- a/connect.c
+++ b/connect.c
@@ -179,7 +179,6 @@ static int count_refspec_match(const char *pattern,
 	for (weak_match = match = 0; refs; refs = refs->next) {
 		char *name = refs->name;
 		int namelen = strlen(name);
-		int weak_match;
 
 		if (namelen < patlen ||
 		    memcmp(name + namelen - patlen, pattern, patlen))
This one is an obvious bug.  Essentially, it makes weak matches
ignored.  Unfortunately this has been hiding a larger bug in the
caller of this function.  I am refactoring the mess right now.

Re: [RFC][PATCH 10/10] Sparse: fix a "symbol 'weak_match' shadows an earlier one" warning

From: Ramsay Jones <hidden>
Date: 2016-06-15 22:43:15

Junio C Hamano wrote:
Ramsay Jones [off-list ref] writes:
quoted
Signed-off-by: Ramsay Jones <redacted>
---
 connect.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/connect.c b/connect.c
index da89c9c..d4051dd 100644
--- a/connect.c
+++ b/connect.c
@@ -179,7 +179,6 @@ static int count_refspec_match(const char *pattern,
 	for (weak_match = match = 0; refs; refs = refs->next) {
 		char *name = refs->name;
 		int namelen = strlen(name);
-		int weak_match;
 
 		if (namelen < patlen ||
 		    memcmp(name + namelen - patlen, pattern, patlen))
This one is an obvious bug.  
Indeed ;-)
Also, I'm guessing it does not bring your machine down like a house of cards.

... Essentially, it makes weak matches
ignored.  Unfortunately this has been hiding a larger bug in the
caller of this function.  I am refactoring the mess right now.
Great. Hopefully it will also address the cygwin issue.

ATB

Ramsay Jones
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help