public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH] sequencer.c: Fix a sparse warning
@ 2012-04-14 17:26 Ramsay Jones
  0 siblings, 0 replies; only message in thread
From: Ramsay Jones @ 2012-04-14 17:26 UTC (permalink / raw)
  To: nhorman; +Cc: Junio C Hamano, GIT Mailing-list


In particular, sparse complains as follows:

        SP sequencer.c
    sequencer.c:262:5: warning: symbol 'run_git_commit' was not \
        declared. Should it be static?

In order to suppress the warning, since the run_git_commit() function
does not need to be a global symbol, we simply add the static modifier
to the function definition.

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

Hi Neil,

In commit 85b2713d ("git-cherry-pick: add --keep-redundant-commits option",
11-04-2012), you removed the static modifier from run_git_commit() without
adding an extern declaration to the sequencer.h header file. This causes
sparse to bark, as above. However, since that function is not called outside
of sequencer.c, it seems best to simply add it back ... :-)

[Note that, despite remove_sequencer_state() being declared extern in the
header file, it is also not used outside sequencer.c, so ... ]

So, if you need to re-submit this patch, could you please squash this patch
into your commit. Thanks!

ATB,
Ramsay Jones

 sequencer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sequencer.c b/sequencer.c
index d4262cf..6f28430 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -259,7 +259,7 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
  * If we are revert, or if our cherry-pick results in a hand merge,
  * we had better say that the current user is responsible for that.
  */
-int run_git_commit(const char *defmsg, struct replay_opts *opts, int empty)
+static int run_git_commit(const char *defmsg, struct replay_opts *opts, int empty)
 {
 	struct argv_array array;
 	int rc;
-- 
1.7.10

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-14 17:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-14 17:26 [PATCH] sequencer.c: Fix a sparse warning Ramsay Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox