[PATCH] sequencer.c: Fix a sparse warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>
---

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


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]