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

Re: [PATCH] xmalloc: include size in the failure message

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 20, 2010, 16:31 UTC
Message-ID
<7vd3tdckjz.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1282316991-23320-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 6 quoted lines
>> Under NO_C99_FORMAT the format and the argument would not match if size_t
>> is not the same size as uint.  As the one in sha1_file.c seems to be done
>> in a better way, let's use that one.
>
> Sounds good. Not sure why we don't basically use the %lu version
> everywhere though.

I have been wondering about the same thing, but perhaps because we won't have to worry too much about size_t needing to be unsigned long long on older platforms where %z is not supported, while we expect %z will be available on larger where using %lu may become an issue?

Previous: Matthieu Moy
Message 4 of 4 in “xmalloc: include size in the failure message”
  1. xmalloc: include size in the failure messageMatthieu Moy, Aug 20, 2010
  2. Junio C HamanoAug 20, 2010
  3. xmalloc: include size in the failure messageMatthieu Moy, Aug 20, 2010
  4. Junio C HamanoAug 20, 2010

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.