git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] builtin/tag.c: Fix a sparse warning

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Feb 13, 2012, 18:24 UTC
Message-ID
<4F395569.8030106@ramsay1.demon.co.uk>
In particular, sparse complains as follows:
        SP builtin/tag.c
    builtin/tag.c:411:5: warning: symbol 'parse_opt_points_at' was \
        not declared. Should it be static?

In order to suppress the warning, since the parse_opt_points_at() function does not need to be an external symbol, we simply add the static modifier to the function definition.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 builtin/tag.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin/tag.c b/builtin/tag.c
index 8cfaaf8..fe7e5e5 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -408,7 +408,7 @@ static int strbuf_check_tag_ref(struct strbuf *sb, const char *name)
 	return check_refname_format(sb->buf, 0);
 }
 
-int parse_opt_points_at(const struct option *opt __attribute__ ((unused)),
+static int parse_opt_points_at(const struct option *opt __attribute__((unused)),
 			const char *arg, int unset)
 {
 	unsigned char sha1[20];
-- 
1.7.9
Next: Tom Grennan
Message 1 of 2 in “builtin/tag.c: Fix a sparse warning”
  1. builtin/tag.c: Fix a sparse warningRamsay Jones, Feb 13, 2012
  2. Tom GrennanFeb 13, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.