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

[PATCH] fast_export.c: Fix a compiler warning

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Aug 19, 2012, 15:29 UTC
Message-ID
<5031063E.3090405@ramsay1.demon.co.uk>
In particular, gcc complains thus:
        CC vcs-svn/fast_export.o
    vcs-svn/fast_export.c: In function 'fast_export_begin_note':
    vcs-svn/fast_export.c:77: warning: long long unsigned int format, \
        different type arg (arg 2)

In order to fix the warning, we cast the second size_t argument in the call to printf to uintmax_t.

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

If you need to re-roll your patches in the 'fa/remote-svn' branch, could you please squash this fix into them. [This was implemented on top of commit 2ce959ba, but you will probably want to make the equivalent change to commit d319a37c ("Create a note for every imported commit containing svn metadata", 17-08-2012) instead. Note that, because of the context lines in the patch, it won't apply as-is.]

Thanks!

ATB, Ramsay Jones

 vcs-svn/fast_export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c
index c780d32..dd09c7d 100644
--- a/vcs-svn/fast_export.c
+++ b/vcs-svn/fast_export.c
@@ -74,7 +74,7 @@ void fast_export_begin_note(uint32_t revision, const char *author,
 	size_t loglen = strlen(log);
 	printf("commit %s\n", note_ref);
 	printf("committer %s <%s@%s> %ld +0000\n", author, author, "local", timestamp);
-	printf("data %"PRIuMAX"\n", loglen);
+	printf("data %"PRIuMAX"\n", (uintmax_t) loglen);
 	fwrite(log, loglen, 1, stdout);
 	if (firstnote) {
 		if (revision > 1)
-- 
1.7.11.2
Next: Florian Achleitner
Message 1 of 4 in “fast_export.c: Fix a compiler warning”
  1. fast_export.c: Fix a compiler warningRamsay Jones, Aug 19, 2012
  2. Florian AchleitnerAug 20, 2012
  3. Junio C HamanoAug 20, 2012
  4. Ramsay JonesAug 21, 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.