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

[PATCH 4/9] sparse: Fix an "symbol 'format_subject' not declared" warning

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Apr 7, 2011, 18:26 UTC
Message-ID
<4D9E01CF.5060903@ramsay1.demon.co.uk>

In order to fix the warning, we add an extern declaration for this function to the "commit.h" header file, along with all other non- static functions defined in pretty.c. Also, we remove the function declaration from builtin/shortlog.c, since it is no longer needed.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 builtin/shortlog.c |    3 ---
 commit.h           |    2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index f5efc67..b6f4b0e 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -29,9 +29,6 @@ static int compare_by_number(const void *a1, const void *a2)
 		return -1;
 }
 
-const char *format_subject(struct strbuf *sb, const char *msg,
-			   const char *line_separator);
-
 static void insert_one_record(struct shortlog *log,
 			      const char *author,
 			      const char *oneline)
diff --git a/commit.h b/commit.h
index 4198513..b3c3bb7 100644
--- a/commit.h
+++ b/commit.h
@@ -90,6 +90,8 @@ extern char *logmsg_reencode(const struct commit *commit,
 extern char *reencode_commit_message(const struct commit *commit,
 				     const char **encoding_p);
 extern void get_commit_format(const char *arg, struct rev_info *);
+extern const char *format_subject(struct strbuf *sb, const char *msg,
+				  const char *line_separator);
 extern void userformat_find_requirements(const char *fmt, struct userformat_want *w);
 extern void format_commit_message(const struct commit *commit,
 				  const char *format, struct strbuf *sb,
-- 
1.7.4
Message 1 of 1 in “sparse: Fix an "symbol 'format_subject' not declared" warning”
  1. 4/9 sparse: Fix an "symbol 'format_subject' not declared" warningRamsay Jones, Apr 7, 2011

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.