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

Re: [PATCH] minor Makefile and local-pull.c edits for Darwin

From
HAH. Peter Anvin <hpa@zytor.com>
Date
May 10, 2005, 04:30 UTC
Message-ID
<428038D0.5000706@zytor.com>
In-Reply-To
<20050510021105.53984.qmail@web41213.mail.yahoo.com>
Mark Allen wrote:
Show 14 quoted lines
>  
> Index: local-pull.c
> ===================================================================
> --- 972d8624458936868e6f392b40858b7c362af8cd/local-pull.c  (mode:100644)
> +++ uncommitted/local-pull.c  (mode:100644)
> @@ -71,7 +71,7 @@
>                 close(ofd);
>                 if (status)
>                         fprintf(stderr, "cannot write %s (%ld bytes)\n",
> -                               dest_filename, st.st_size);
> +                               dest_filename, (long) st.st_size);
>                 else
>                         pull_say("copy %s\n", hex);
>                 return status;

This is just plain WRONG. st.st_size is longer than long on many architectures, including Linux/i386.

The easiest way to deal with it is to #include <inttypes.h>, use %jd and cast it to (intmax_t). That is, however, a C99-ism.

	-hpa
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 9 in “minor Makefile and local-pull.c edits for Darwin”
  1. minor Makefile and local-pull.c edits for DarwinMark Allen, May 10, 2005
  2. Daniel BarkalowMay 10, 2005
  3. Junio C HamanoMay 10, 2005
  4. H. Peter AnvinMay 10, 2005
  5. Junio C HamanoMay 10, 2005
  6. H. Peter AnvinMay 10, 2005
  7. H. Peter AnvinMay 10, 2005
  8. Junio C HamanoMay 10, 2005
  9. H. Peter AnvinMay 10, 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.