Re: [PATCH] Convert size datatype to size_t
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 9, 2017, 16:51 UTC
- Message-ID
- <xmqqa8387khm.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170809072613.GA20347@mail.zuhause>
Martin Koegler <martin.koegler@chello.at> writes:
Show 14 quoted lines
> On Wed, Aug 09, 2017 at 09:19:06AM +0200, Martin Koegler wrote: >> On Tue, Aug 08, 2017 at 11:04:20PM -0700, Junio C Hamano wrote: >> > As https://travis-ci.org/git/git/jobs/262463159 shows, unfortunately >> > it turns out that things are not so simple X-<. On Linux32, size_t >> > is uint, which is the same size as ulong, but "%lu" is not appropriate >> > for showing a size_t value. >> > >> > So you are correct to say in the comment under three-dashes that >> > there is much more to change in the codebase. >> >> I'll post a new version fixing the *printf issues. > > What is the correct format specifier for size_t? > Linux has %zu (C99). Is that OK for the GIT codebase?
I haven't double checked, but IIRC we cast to uintmax_t and use PRIuMAX.