threads / patch / 34552

patchrevision.c: Fix a sparse warning

Subject: [PATCH] revision.c: Fix a sparse warning

## tl;dr

One message between Jul 27, 2013 and Jul 27, 2013. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Ramsay Jones· Jul 27, 2013, 18:39 UTC · lore

Sparse issues an "symbol 'saved_parents_slab' was not declared. Should it be static?" warning. In order to suppress the warning, since this symbol does not require more than file visibility, we simply add the static modifier to its declaration.

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

In addition to the gcc warning, sparse weighs in with this warning, provoked by commit 3b3d83e5 ("[PERHAPS LIKE THIS] log: use true parents for diff even when rewriting", 22-07-2013).

If you update this commit, could you please squash this into the new patch.
Thanks!

ATB, Ramsay Jones

 revision.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to revision.c +1 −1
diff --git a/revision.c b/revision.c
index f242363..fa355d0 100644
--- a/revision.c
+++ b/revision.c
@@ -3074,7 +3074,7 @@ void put_revision_mark(const struct rev_info *revs, const struct commit *commit)
 }
 
 define_commit_slab(saved_parents, struct commit_list *);
-struct saved_parents saved_parents_slab;
+static struct saved_parents saved_parents_slab;
 static int saved_parents_initialized;
 
 void save_parents(struct commit *commit)
-- 
1.8.3

← back to recent threads