Skip to contentSkip to conversation

dir.c: Fix a sparse warning

PATCH New Ramsay Jones 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

In particular, sparse complains as follows:

SP dir.c
dir.c:291:12: warning: symbol 'wildcards' was not declared. \
Should it be static?

In order to suppress the warning, since 'wildcards' does not need to be an external symbol, we simply add the static modifier to the declaration.

---

Hi Nguyen,

If you need to re-roll the 'nd/exclude-workaround-top-heavy' branch, could you please squash this into commit dedbd80c ("exclude: do strcmp as much as possible before fnmatch", 26-05-2012).

Thanks!

ATB,
Ramsay Jones

 dir.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dir.c +1 -1
index 1b1a325..571eb0d 100644
@@ -288,7 +288,7 @@ int match_pathspec_depth(const struct pathspec *ps,
 	return retval;
 }
 
-const char *wildcards = "*?[{\\";
+static const char *wildcards = "*?[{\\";
 
 static int no_wildcard(const char *string)
 {
Signature · 1 line
1.7.10