git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Rose via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Seija Kijin <doremylover123@gmail.com>
Subject: Re: [PATCH v16] git: change variable types to match what is assigned to them
Date: Wed, 15 Mar 2023 12:09:58 -0700	[thread overview]
Message-ID: <xmqq3565q1a1.fsf@gitster.g> (raw)
In-Reply-To: <pull.1399.v16.git.git.1678886439331.gitgitgadget@gmail.com> (Rose via GitGitGadget's message of "Wed, 15 Mar 2023 13:20:38 +0000")

"Rose via GitGitGadget" <gitgitgadget@gmail.com> writes:

>       @@ add-interactive.c: static ssize_t find_unique(const char *string, struct prefix_item_list *list)
>      @@ advice.c: void advise_if_enabled(enum advice_type type, const char *advice, ...)
>        
>        	if (!strcmp(var, "color.advice")) {
>        		advice_use_color = git_config_colorbool(var, value);
>      +@@ advice.c: int git_default_advice_config(const char *var, const char *value)
>      + 
>      + void list_config_advices(struct string_list *list, const char *prefix)
>      + {
>      +-	int i;
>      ++	size_t i;
>      + 
>      + 	for (i = 0; i < ARRAY_SIZE(advice_setting); i++)
>      + 		list_config_item(list, prefix, advice_setting[i].key);

Here, the advice_setting[] is not an attacker controlled array with
an unbound size.  It is a known static array the program prepares.
Converting it to use size_t as an index is a totally pointless
churn.

Some of the changes in this patch may have merit, but seeing a
change like this as the first change in the iteration makes me lose
interest in reading this huge message that weighs more than 7000
lines.  If you are looking for "for (x = 0;" where x is declared of
any type other than size_t and blindly converting them, please stop.

      parent reply	other threads:[~2023-03-15 19:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  2:29 [PATCH] git: edit variable types to match what is assigned to them Rose via GitGitGadget
2022-12-16  3:36 ` Junio C Hamano
2022-12-16 17:19 ` [PATCH v2] " Rose via GitGitGadget
2022-12-16 22:09   ` [PATCH v3] " Rose via GitGitGadget
2022-12-16 23:52     ` Junio C Hamano
2022-12-21  5:01     ` [PATCH v4] " Rose via GitGitGadget
2022-12-23 19:26       ` [PATCH v5] " Rose via GitGitGadget
2022-12-23 19:35         ` [PATCH v6] " Rose via GitGitGadget
2022-12-23 19:40           ` [PATCH v7] " Rose via GitGitGadget
2022-12-23 19:43             ` [PATCH v8] " Rose via GitGitGadget
2022-12-23 19:46               ` [PATCH v9] " Rose via GitGitGadget
2022-12-23 19:52                 ` [PATCH v10] " Rose via GitGitGadget
2022-12-29 15:45                   ` [PATCH v11] " Rose via GitGitGadget
2022-12-29 16:11                     ` [PATCH v12] " Rose via GitGitGadget
2023-01-03 17:37                       ` [PATCH v13] " Rose via GitGitGadget
2023-01-08 14:52                         ` [PATCH v14] git: change " Rose via GitGitGadget
2023-01-08 19:03                           ` [PATCH v15] " Rose via GitGitGadget
2023-03-15 13:20                             ` [PATCH v16] " Rose via GitGitGadget
2023-03-15 13:26                               ` [PATCH v17] " Rose via GitGitGadget
2023-03-15 19:09                               ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq3565q1a1.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=doremylover123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).