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

Re: [PATCH] use C99 declaration of variable in for() loop

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 15, 2024, 17:33 UTC
Message-ID
<xmqqcysxskd9.fsf@gitster.g>
In-Reply-To
<20240215094243.147057-1-gitter.spiros@gmail.com>
Elia Pinto <gitter.spiros@gmail.com> writes:
Show 5 quoted lines
> With the exception of cbtree.c, which would need initial
> reworking to remove the usage of goto, it expands the
> use of variable scope reduction in for loops as
> permitted by the C99 standard, which was first introduced
> in the git codebase with commit 44ba10d6.
Thanks, but ...

Our test balloon may have proven that nobody will be inconvenienced, and it does mean we can be liberal using it when we add new code or update existing loops "while at it", but I personally do not think such a code churn is very welcome.

Previous: Elia PintoNext: Christian Couder
Message 2 of 8 in “use C99 declaration of variable in for() loop”
  1. use C99 declaration of variable in for() loopElia Pinto, Feb 15, 2024
  2. Junio C HamanoFeb 15, 2024
  3. Christian CouderFeb 15, 2024
  4. Junio C HamanoFeb 15, 2024
  5. Elia PintoFeb 15, 2024
  6. Junio C HamanoFeb 15, 2024
  7. brian m. carlsonFeb 15, 2024
  8. Junio C HamanoFeb 15, 2024

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.