public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1•demon.co.uk>
To: nhorman@tuxdriver•com
Cc: Junio C Hamano <gitster@pobox•com>,
	GIT Mailing-list <git@vger•kernel.org>
Subject: [PATCH] sequencer.c: Fix a sparse warning
Date: Sat, 14 Apr 2012 18:26:35 +0100	[thread overview]
Message-ID: <4F89B34B.70907@ramsay1.demon.co.uk> (raw)


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

                 reply	other threads:[~2012-04-14 17:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F89B34B.70907@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1$(echo .)demon.co.uk \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=nhorman@tuxdriver$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox