Skip to contentSkip to conversation

grep.c: Fix a sparse warning

PATCH In review Ramsay Jones 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 grep.c: Fix a sparse warning

In particular, sparse complains that "... 'dump_grep_expression' was not declared. Should it be static?". In order to suppress the warning, since this function does not need more than file scope, we simply include the static modifier in it's declaration.

---

Hi Junio,

I prefer to catch these before they progress to next, but it seems I've not been quick enough lately! Sorry about that. :( [I will have to git-fetch more frequently; at present I only fetch about 3 times a week.]

I've been away for a few days, so I'm well behind ... (I'm just about to download 350+ emails for me to read tonight!).

ATB,
Ramsay Jones

 grep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grep.c +1 -1
index 925aa92..38c4d75 100644
@@ -403,7 +403,7 @@ static void dump_grep_expression_1(struct grep_expr *x, int in)
 	}
 }
 
-void dump_grep_expression(struct grep_opt *opt)
+static void dump_grep_expression(struct grep_opt *opt)
 {
 	struct grep_expr *x = opt->pattern_expression;
 
Signature · 1 line
1.7.12
#1 lore raw
Quoted 10 lines · Ramsay Jones

In particular, sparse complains that "... 'dump_grep_expression' was not declared. Should it be static?". In order to suppress the warning, since this function does not need more than file scope, we simply include the static modifier in it's declaration.

---

Hi Junio,

Quoted 7 lines

I prefer to catch these before they progress to next, but it seems I've not been quick enough lately! Sorry about that. :( [I will have to git-fetch more frequently; at present I only fetch about 3 times a week.]

I've been away for a few days, so I'm well behind ... (I'm just about to download 350+ emails for me to read tonight!).

Thanks; doesn't 07a7d65 (grep.c: mark private file-scope symbols as static, 2012-09-15) cover this already, though?

Quoted 19 lines

ATB,
Ramsay Jones

 grep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grep.c +1 -1
index 925aa92..38c4d75 100644
@@ -403,7 +403,7 @@ static void dump_grep_expression_1(struct grep_expr *x, int in)
 	}
 }
 
-void dump_grep_expression(struct grep_opt *opt)
+static void dump_grep_expression(struct grep_opt *opt)
 {
 	struct grep_expr *x = opt->pattern_expression;