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, 23:43 UTC
Message-ID
<xmqqa5o1mgyo.fsf@gitster.g>
In-Reply-To
<Zc6abO6RV9RwpABR@tapette.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 5 quoted lines
> I will also say that sending one giant patch for this may be a bit hard
> to review.  While I will defer to Junio's opinion as the maintainer, I
> would be more inclined to review this kind of series if it came in in
> smaller patches, a few at a time, in which case I would find it a
> welcome improvement.

True. As to the specific topic of using "for (int i = 0; ...)", it is tedious to review for mistakes and 17000+ lines of patch is not a way to do so. I do not think I would be able to spot a change in behaviour caused by a hunk like this

	int i = 3;
	... after some operations ...
-	for (i = 0; i < 5; i++)
+	for (int i = 0; i < 5; i++)
		if (condition_on_i(i))
			break;
	... after some operations ...
	return i;

after scanning similar changes for 1000+ times in a single huge patch.

Previous: brian m. carlson
Message 8 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.