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

Re: [GSoC PATCH] pathspec: fix sign comparison warnings

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 13, 2025, 15:33 UTC
Message-ID
<xmqqcyelq714.fsf@gitster.g>
In-Reply-To
<CAOLa=ZRNJD7NqceGQ4B8ox+50m2q1nU1t29x7O0roc=-_4ww0w@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
> Also a bigger question is, shouldn't the type of `pathspec.nr` and
> 'istate.cache_nr' be the actual change required? Shouldn't they be set
> to 'size_t'?

Please do not blindly advocate the idea that size_t is always the right type for any countables. It is not.

Platform natural way to count things is either "unsigned int", if you are only counting, or "int", if you need to be able to signal an unusual state other than "here is now many we have in the set", like how index related functions uses (-pos-1) to signal a location in the same range with different meanings.

Previous: Karthik NayakNext: Karthik Nayak
Message 5 of 11 in “pathspec: fix sign comparison warnings”
  1. pathspec: fix sign comparison warningsArnav Bhate, Mar 12, 2025
  2. Karthik NayakMar 13, 2025
  3. Arnav BhateMar 13, 2025
  4. Karthik NayakMar 13, 2025
  5. Junio C HamanoMar 13, 2025
  6. Karthik NayakMar 13, 2025
  7. Arnav BhateMar 16, 2025
  8. pathspec: fix sign comparison warningsArnav Bhate, Mar 29, 2025
  9. Arnav BhateMar 29, 2025
  10. Junio C HamanoMar 29, 2025
  11. pathspec: fix sign comparison warningsArnav Bhate, Mar 30, 2025

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.