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

[PATCH] git.c: fix sparse warning

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Jun 1, 2020, 23:27 UTC
Message-ID
<d9686e75-0792-33f7-dd70-3dc8ca6c4d66@ramsayjones.plus.com>

Commit 4acc44d720 (config: add setting to ignore sparsity patterns in some cmds, 2020-05-27) adds an external symbol definition without a corresponding external symbol declaration. This causes sparse to complain: "symbol 'opt_restrict_to_sparse_paths' was not declared. Should it be static?".

In order to suppress the warning, #include the 'sparse-checkout.h' header file, which contains the required extern declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Matheus,

If you need to re-roll your 'mt/grep-sparse-checkout' branch, could you please squash this into the relevant patch.

[This is the minimum fix - but I might be tempted to move the definition of the variable to 'sparse-checkout.c' as well.]

Thanks!

ATB, Ramsay Jones

 git.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/git.c b/git.c
index 07de4363ef..6e62001f2f 100644
--- a/git.c
+++ b/git.c
@@ -5,6 +5,7 @@
 #include "run-command.h"
 #include "alias.h"
 #include "shallow.h"
+#include "sparse-checkout.h"
 
 #define RUN_SETUP		(1<<0)
 #define RUN_SETUP_GENTLY	(1<<1)
-- 
2.26.2
Next: Matheus Tavares Bernardino
Message 1 of 2 in “git.c: fix sparse warning”
  1. git.c: fix sparse warningRamsay Jones, Jun 1, 2020
  2. Matheus Tavares BernardinoJun 3, 2020

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.