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

[PATCH] fix field width/precision warnings in blame.c

From
Luck, Tony <tony.luck@intel.com>
Date
Mar 21, 2006, 23:28 UTC
Message-ID
<200603212328.k2LNS6eK019132@agluck-lia64.sc.intel.com>

Using "size_t" values for printf field width/precision upsets gcc, it wants to see an "int".

Signed-off-by: Tony Luck <tony.luck@intel.com>
---

gcc -o blame.o -c -g -O2 -Wall -DSHA1_HEADER='<openssl/sha.h>' blame.c blame.c: In function `main': blame.c:864: warning: field width is not type int (arg 2) blame.c:864: warning: field precision is not type int (arg 3) blame.c:868: warning: field width is not type int (arg 2) blame.c:868: warning: field precision is not type int (arg 3)

diff --git a/blame.c b/blame.c
index 9c97aec..7e88833 100644
--- a/blame.c
+++ b/blame.c
@@ -748,7 +748,7 @@ int main(int argc, const char **argv)
 	struct commit_info ci;
 	const char *buf;
 	int max_digits;
-	size_t longest_file, longest_author;
+	int longest_file, longest_author;
 	int found_rename;
 
 	const char* prefix = setup_git_directory();
Message 1 of 1 in “fix field width/precision warnings in blame.c”
  1. fix field width/precision warnings in blame.cLuck, Tony, Mar 21, 2006

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.