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

[PATCH] builtin/commit.c: fix type warnings from gcc and sparse

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Aug 29, 2014, 16:36 UTC
Message-ID
<5400AC05.9060900@ramsay1.demon.co.uk>

On 32-bit platforms (only), gcc and sparse both issue warnings about the type of the pointer expression passed as the third argument to find_commit_header(). In order to suppress the warnings, we simply change the type of the 'len' variable to size_t.

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

If you need to re-roll your 'jk/commit-author-parsing' series, could you please squash this into the equivalent of commit 95b5989 ("determine_author_info(): reuse parsing functions", 27-08-2014).

Thanks!

ATB, Ramsay Jones

 builtin/commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index a9bef73..7cb9981 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -583,7 +583,7 @@ static void determine_author_info(struct strbuf *author_ident)
 
 	if (author_message) {
 		struct ident_split ident;
-		unsigned long len;
+		size_t len;
 		const char *a;
 
 		a = find_commit_header(author_message_buffer, "author", &len);
-- 
2.1.0
Next: Jeff King
Message 1 of 3 in “builtin/commit.c: fix type warnings from gcc and sparse”
  1. builtin/commit.c: fix type warnings from gcc and sparseRamsay Jones, Aug 29, 2014
  2. Jeff KingAug 29, 2014
  3. Junio C HamanoAug 29, 2014

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.