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

Re: [PATCH] Convert size datatype to size_t

From
Martin Koegler <martin.koegler@chello.at>
Date
Aug 9, 2017, 07:19 UTC
Message-ID
<20170809071906.GA19310@mail.zuhause>
In-Reply-To
<xmqq8tit8efv.fsf@gitster.mtv.corp.google.com>
On Tue, Aug 08, 2017 at 11:04:20PM -0700, Junio C Hamano wrote:
Show 15 quoted lines
> Martin Koegler <martin.koegler@chello.at> writes:
> 
> > From: Martin Koegler <martin.koegler@chello.at>
> >
> > It changes the signature of the core object access function
> > including any other functions to assure a clean compile if
> > sizeof(size_t) != sizeof(unsigned long).
> 
> 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.
My patch is based on V2 of my "Fix delta integer overflows" patch [also changing the variable types].
I'll post a new version fixing the *printf issues.

The patch can't be splitted without causing compile errors, if sizeof(size_t) != sizeof(ulong). Many variables are not changed to keep the patch small.

Regards, Martin

Previous: Junio C HamanoNext: Martin Koegler
Message 5 of 9 in “Convert size datatype to size_t”
  1. Convert size datatype to size_tMartin Koegler, Aug 8, 2017
  2. Junio C HamanoAug 8, 2017
  3. Junio C HamanoAug 8, 2017
  4. Junio C HamanoAug 9, 2017
  5. Martin KoeglerAug 9, 2017
  6. Martin KoeglerAug 9, 2017
  7. Junio C HamanoAug 9, 2017
  8. Johannes SchindelinAug 9, 2017
  9. Johannes SchindelinAug 9, 2017

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.