[PATCH] bisect: add read_bisect_terms() to the public interface

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

 



Commit 833bd64f ("bisect: simplify the addition of new bisect terms",
29-06-2015) added a public function, read_bisect_terms(), to 'bisect.c'
which was then called by code in 'revision.c', having directly referenced
the symbol with an explicit external declaration. This causes sparse to
complain ('symbol not declared. Should it be static?').

In order to suppress the warning, move the external declaration to the
"bisect.h" header file and '#include' the header in 'revision.c'.

Signed-off-by: Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxx>
---

Hi Junio,

You recently mentioned that you may squash a fix to the 'ref-filter'
series in next whilst re-winding next. How about squashing this patch
into 'ad/bisect-cleanup' at the same time?

As you know, I have been 'up to my eyeballs' lately, so this patch is
(almost) a 'five minute quick fix' to the sparse warning. (You know that
I prefer to catch these while they are still in pu, but I missed this
one ... sorry!) So, if this patch is not appropriate (since I have not
followed any of the discussion which lead to this commit), please ignore!

BTW, a large part of 'bisect.h', namely the declartions of BISECT_SHOW_ALL,
REV_LIST_QUIET and rev_list_info are only referenced by 'builtin/rev-list.c'.
Noticed in passing ...

ATB,
Ramsay Jones

 bisect.h   | 2 ++
 revision.c | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bisect.h b/bisect.h
index 2a6c831..acd12ef 100644
--- a/bisect.h
+++ b/bisect.h
@@ -26,4 +26,6 @@ extern int bisect_next_all(const char *prefix, int no_checkout);
 
 extern int estimate_bisect_steps(int all);
 
+extern void read_bisect_terms(const char **bad, const char **good);
+
 #endif
diff --git a/revision.c b/revision.c
index b6b2cf7..5350139 100644
--- a/revision.c
+++ b/revision.c
@@ -18,6 +18,7 @@
 #include "commit-slab.h"
 #include "dir.h"
 #include "cache-tree.h"
+#include "bisect.h"
 
 volatile show_early_output_fn_t show_early_output;
 
@@ -2079,8 +2080,6 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
 	ctx->argc -= n;
 }
 
-extern void read_bisect_terms(const char **bad, const char **good);
-
 static int for_each_bisect_ref(const char *submodule, each_ref_fn fn, void *cb_data, const char *term) {
 	struct strbuf bisect_refs = STRBUF_INIT;
 	int status;
-- 
2.5.0
--
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]