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

[PATCH] revision.c: Fix a sparse warning

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Jul 27, 2013, 18:39 UTC
Message-ID
<51F413E3.7000608@ramsay1.demon.co.uk>

Sparse issues an "symbol 'saved_parents_slab' was not declared. Should it be static?" warning. In order to suppress the warning, since this symbol does not require more than file visibility, we simply add the static modifier to its declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Thomas,

In addition to the gcc warning, sparse weighs in with this warning, provoked by commit 3b3d83e5 ("[PERHAPS LIKE THIS] log: use true parents for diff even when rewriting", 22-07-2013).

If you update this commit, could you please squash this into the new patch.
Thanks!

ATB, Ramsay Jones

 revision.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/revision.c b/revision.c
index f242363..fa355d0 100644
--- a/revision.c
+++ b/revision.c
@@ -3074,7 +3074,7 @@ void put_revision_mark(const struct rev_info *revs, const struct commit *commit)
 }
 
 define_commit_slab(saved_parents, struct commit_list *);
-struct saved_parents saved_parents_slab;
+static struct saved_parents saved_parents_slab;
 static int saved_parents_initialized;
 
 void save_parents(struct commit *commit)
-- 
1.8.3
Message 1 of 1 in “revision.c: Fix a sparse warning”
  1. revision.c: Fix a sparse warningRamsay Jones, Jul 27, 2013

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.