git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] dir.c: Fix a sparse warning

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Jun 2, 2012, 17:05 UTC
Message-ID
<4FCA47E0.7020700@ramsay1.demon.co.uk>
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.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
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(-)
diff --git a/dir.c b/dir.c
index 1b1a325..571eb0d 100644
--- a/dir.c
+++ b/dir.c
@@ -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)
 {
-- 
1.7.10
Message 1 of 1 in “dir.c: Fix a sparse warning”
  1. dir.c: Fix a sparse warningRamsay Jones, Jun 2, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.