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

[PATCH] commit: fix sparse 'not declared' warning

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
May 14, 2018, 19:20 UTC
Message-ID
<e2c4276f-bcfd-faaa-f9ee-cb50e99da663@ramsayjones.plus.com>
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Duy,

If you need to re-roll your 'nd/commit-util-to-slab' branch, could you please squash this into the relevant patch (commit 37de2f0a93, "merge: use commit-slab in merge remote desc instead of commit->util", 2018-05-13).

Also, my 'static-check.pl' script has pinged on this series due to the use of the 'implement_shared_commit_slab' macro in revision.c (commit 85d055e876, "revision.c: use commit-slab for show_source", 2018-05-13).

This is because that macro only allows you to set the 'scope' of the complete set of functions that are declared there - in this case three of them are not called (well, two are actually called by another two functions in the set) outside of revision.c.

In particular, the functions 'clear_revision_sources', 'init_revision_sources_with_stride' (used in init_##slabname) and 'revision_sources_at_peek' (used in slabname##_at).

I haven't thought too deeply about this issue, or if it even matters, so I have no solutions to offer. ;-)

Thanks!

ATB, Ramsay Jones

 commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commit.c b/commit.c
index 38a3c0e5e..c0582df16 100644
--- a/commit.c
+++ b/commit.c
@@ -1657,7 +1657,7 @@ int commit_tree_extended(const char *msg, size_t msg_len,
 }
 
 define_commit_slab(merge_desc_slab, struct merge_remote_desc *);
-struct merge_desc_slab merge_desc_slab = COMMIT_SLAB_INIT(1, merge_desc_slab);
+static struct merge_desc_slab merge_desc_slab = COMMIT_SLAB_INIT(1, merge_desc_slab);
 
 struct merge_remote_desc *merge_remote_util(struct commit *commit)
 {
-- 
2.17.0
Message 1 of 1 in “commit: fix sparse 'not declared' warning”
  1. commit: fix sparse 'not declared' warningRamsay Jones, May 14, 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.