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

Re: [PATCH/RFC v1 1/1] Use size_t instead of unsigned long

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 20, 2018, 01:36 UTC
Message-ID
<xmqqin0scyxh.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20181119163323.GA15913@tor.lan>
Torsten Bögershausen <tboegi@web.de> writes:
Show 8 quoted lines
> The only problematic system is Win64, where "unsigned long" is 32 bit,
> and therefore we must use size_t to address data in memory.
> This is not to be confused with off_t, which is used for "data on disk"
> (and nothing else) or timestamp_t which is used for timestamps (and nothing else).
>
> I haven't followed the "coccinelle script" development at all, if someone
> makes a patch do replace "unsigned long" with size_t, that could replace
> my whole patch. (Some of them may be downgraded to "unsigned int" ?)

This paragraph makes it sound as if this patch is s/ulong/size_t/, but that contradicts with the previous paragraph, no? It is much better to leave a ulong that is not about the size of a memory region as-is, to be turned into appropriate and correct type later, than changing it into another wrong type (size_t).

In short, we could do ulong to size_t with Coccinelle, but I do not think we want to blindly rewrite all.

Previous: Torsten BögershausenNext: tboegi@web.de
Message 7 of 13 in “Use size_t instead of unsigned long”
  1. 1/1 Use size_t instead of unsigned longtboegi@web.de, Nov 17, 2018
  2. Derrick StoleeNov 18, 2018
  3. Junio C HamanoNov 18, 2018
  4. Torsten BögershausenNov 19, 2018
  5. René ScharfeNov 19, 2018
  6. Torsten BögershausenNov 19, 2018
  7. Junio C HamanoNov 20, 2018
  8. 1/1 Use size_t instead of 'unsigned long' for data in memorytboegi@web.de, Nov 20, 2018
  9. Derrick StoleeNov 21, 2018
  10. Thomas BraunJan 16, 2019
  11. Torsten BögershausenJan 19, 2019
  12. Thomas BraunJan 22, 2019
  13. 1/1 Use size_t instead of 'unsigned long' for data in memorytboegi@web.de, Apr 13, 2019

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.