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

[PATCH] Fix ptrdiff_t vs. int

From
MOMarkus F.X.J. Oberhumer <markus@oberhumer.com>
Date
May 27, 2005, 13:20 UTC
Message-ID
<42971EB4.2050403@oberhumer.com>

This trivial patch fixes an obvious ptrdiff_t vs. int mismatch. Which makes we wonder why Linus isn't hitting this on his ppc64 - maybe it's time to start using -Werror...

Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>
-- 
Markus Oberhumer, <markus@oberhumer.com>, http://www.oberhumer.com/







This trivial patch fixes an obvious ptrdiff_t vs. int mismatch.

Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>

Index: diff-tree.c
===================================================================
--- 1348af9952a1d26b2ad14ec8f433322fd79510f3/diff-tree.c  (mode:100644)
+++ 61dcf68d605a8d9204c24278dbdc73b4cf7ccc90/diff-tree.c  (mode:100644)
@@ -274,7 +274,7 @@
 			for (cp = header; *cp; cp = ep) {
 				ep = strchr(cp, '\n');
 				if (ep == 0) ep = cp + strlen(cp);
-				printf("%.*s%c", ep-cp, cp, 0);
+				printf("%.*s%c", (int) (ep-cp), cp, 0);
 				if (*ep) ep++;
 			}
 		}
Next: Danjel McGougan
Message 1 of 13 in “Fix ptrdiff_t vs. int”
  1. Fix ptrdiff_t vs. intMarkus F.X.J. Oberhumer, May 27, 2005
  2. Danjel McGouganMay 27, 2005
  3. Morten WelinderMay 27, 2005
  4. H. Peter AnvinMay 27, 2005
  5. Linus TorvaldsMay 27, 2005
  6. Linus TorvaldsMay 27, 2005
  7. Markus F.X.J. OberhumerMay 27, 2005
  8. H. Peter AnvinMay 27, 2005
  9. Linus TorvaldsMay 27, 2005
  10. Junio C HamanoMay 27, 2005
  11. Adjust diff-helper to diff-tree -v -z changes.Junio C Hamano, May 28, 2005
  12. Linus TorvaldsMay 29, 2005
  13. Junio C HamanoMay 29, 2005

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.