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

[PATCH] sha1_file.c: make parse_sha1_header_extended() static

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Apr 16, 2015, 12:25 UTC
Message-ID
<552FAA35.4050806@ramsay1.demon.co.uk>

commit 9e1f5bc0 ("sha1_file.c: support reading from a loose object of unknown type", 15-04-2015) added a new externally visible function which does not require more than file scope. This causes sparse to issue a warning message about this symbol. In order to suppress the warning, add the static qualifier to the function definition.

[An alternative solution, if this symbol should have external scope, is to add an external declaration for the function to the "cache.h" header file (next to the one for parse_sha1_header()).]

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

If you need to re-roll your patches in the 'kn/cat-file-literally' branch, could you please squash this, or something like it, into the relevant patch.

Thanks!

ATB, Ramsay Jones

 sha1_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sha1_file.c b/sha1_file.c
index 267399d..2b81534 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1642,7 +1642,7 @@ static void *unpack_sha1_rest(git_zstream *stream, void *buffer, unsigned long s
  * too permissive for what we want to check. So do an anal
  * object header parse by hand.
  */
-int parse_sha1_header_extended(const char *hdr, struct object_info *oi,
+static int parse_sha1_header_extended(const char *hdr, struct object_info *oi,
 			       unsigned int flags)
 {
 	struct strbuf typename = STRBUF_INIT;
-- 
2.3.0
Next: Karthik Nayak
Message 1 of 2 in “sha1_file.c: make parse_sha1_header_extended() static”
  1. sha1_file.c: make parse_sha1_header_extended() staticRamsay Jones, Apr 16, 2015
  2. Karthik NayakApr 17, 2015

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.