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

[PATCH 1/2] ref-filter: mark a file-local symbol as static

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Mar 2, 2018, 02:54 UTC
Message-ID
<1d28d866-535c-6d37-4cb9-5decedab3acb@ramsayjones.plus.com>

Commit fcfba37337 ('ref-filter: make "--contains <id>" less chatty if <id> is invalid', 2018-02-23) added the add_str_to_commit_list() function, which causes sparse to issue a "... not declared. Should it be static?" warning for that symbol.

In order to suppress the warning, mark that function as static.
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
 ref-filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ref-filter.c b/ref-filter.c
index f375e7670..69bf7b587 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -2000,7 +2000,7 @@ static void do_merge_filter(struct ref_filter_cbdata *ref_cbdata)
 	free(to_clear);
 }
 
-int add_str_to_commit_list(struct string_list_item *item, void *commit_list)
+static int add_str_to_commit_list(struct string_list_item *item, void *commit_list)
 {
 	struct object_id oid;
 	struct commit *commit;
-- 
2.16.0
Next: Jonathan Nieder
Message 1 of 5 in “ref-filter: mark a file-local symbol as static”
  1. 1/2 ref-filter: mark a file-local symbol as staticRamsay Jones, Mar 2, 2018
  2. Jonathan NiederMar 2, 2018
  3. Ramsay JonesMar 2, 2018
  4. Junio C HamanoMar 2, 2018
  5. Ramsay JonesMar 2, 2018

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.