<div dir="ltr"><div>ptrdiff_t is int rather than long on 32-bit x86 (which is where i happened to test first; i didn't get as far as arm32), and the compiler doesn't care that int==long on ILP32 (presumably to help ILP32-first folks from introducing bugs that only bite LP64 users?).<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 19, 2021 at 3:50 PM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5/19/21 12:46 PM, enh via Toybox wrote:<br>
> <br>
> ---<br>
>  toys/other/readelf.c | 2 +-<br>
>  1 file changed, 1 insertion(+), 1 deletion(-)<br>
> <br>
> diff --git a/toys/other/readelf.c b/toys/other/readelf.c<br>
> index 45afd83a..29e27244 100644<br>
> --- a/toys/other/readelf.c<br>
> +++ b/toys/other/readelf.c<br>
> @@ -57,7 +57,7 @@ static long long elf_get(char **p, int len)<br>
>    long long result;<br>
>  <br>
>    if (*p+len-TT.elf>TT.size)<br>
> -    perror_exit("Access off end: %ld[%d] of %lld\n", *p-TT.elf, len, TT.size);<br>
> +    perror_exit("Access off end: %td[%d] of %lld\n", *p-TT.elf, len, TT.size);<br>
<br>
Applied, but you do realize it's the same everywhere except Windows, right? (LP64.)<br>
<br>
Rob<br>
</blockquote></div></div>