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

From: "H. Peter Anvin" <[email-masked]>
Date: Mon, 09 May 2005 21:30:08 -0700

Mark Allen wrote:

>  
> 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