git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git.c: fix sparse warning
@ 2020-06-01 23:27 Ramsay Jones
  2020-06-03  2:17 ` Matheus Tavares Bernardino
  0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2020-06-01 23:27 UTC (permalink / raw)
  To: Matheus Tavares; +Cc: GIT Mailing-list


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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] git.c: fix sparse warning
  2020-06-01 23:27 [PATCH] git.c: fix sparse warning Ramsay Jones
@ 2020-06-03  2:17 ` Matheus Tavares Bernardino
  0 siblings, 0 replies; 2+ messages in thread
From: Matheus Tavares Bernardino @ 2020-06-03  2:17 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: GIT Mailing-list

On Mon, Jun 1, 2020 at 8:27 PM Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:
>
>
> 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.

Sure! Thanks for catching this.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-03  2:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01 23:27 [PATCH] git.c: fix sparse warning Ramsay Jones
2020-06-03  2:17 ` Matheus Tavares Bernardino

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).