{"thread":{"id":"30241","subject":"[PATCH] sequencer.c: Fix a sparse warning","startedAt":"2012-04-14T17:26:35Z","lastAt":"2012-04-14T17:26:35Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"189266","messageId":"4F89B34B.70907@ramsay1.demon.co.uk","threadId":"30241","inReplyTo":null,"subject":"[PATCH] sequencer.c: Fix a sparse warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-04-14T17:26:35Z","receivedAt":"2012-04-14T17:26:35Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIn particular, sparse complains as follows:\n\n        SP sequencer.c\n    sequencer.c:262:5: warning: symbol 'run_git_commit' was not \\\n        declared. Should it be static?\n\nIn order to suppress the warning, since the run_git_commit() function\ndoes not need to be a global symbol, we simply add the static modifier\nto the function definition.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Neil,\n\nIn commit 85b2713d (\"git-cherry-pick: add --keep-redundant-commits option\",\n11-04-2012), you removed the static modifier from run_git_commit() without\nadding an extern declaration to the sequencer.h header file. This causes\nsparse to bark, as above. However, since that function is not called outside\nof sequencer.c, it seems best to simply add it back ... :-)\n\n[Note that, despite remove_sequencer_state() being declared extern in the\nheader file, it is also not used outside sequencer.c, so ... ]\n\nSo, if you need to re-submit this patch, could you please squash this patch\ninto your commit. Thanks!\n\nATB,\nRamsay Jones\n\n sequencer.c |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex d4262cf..6f28430 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -259,7 +259,7 @@ static int do_recursive_merge(struct commit *base, struct commit *next,\n  * If we are revert, or if our cherry-pick results in a hand merge,\n  * we had better say that the current user is responsible for that.\n  */\n-int run_git_commit(const char *defmsg, struct replay_opts *opts, int empty)\n+static int run_git_commit(const char *defmsg, struct replay_opts *opts, int empty)\n {\n \tstruct argv_array array;\n \tint rc;\n-- \n1.7.10\n"}]}