From: Collin Funk <collin.funk1@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH tig] Fix compiler warning with latest gcc
Date: Fri, 17 Apr 2026 09:38:59 -0700 [thread overview]
Message-ID: <87pl3xsfrw.fsf@gmail.com> (raw)
In-Reply-To: <20260417161228.1578-1-marcel@holtmann.org>
Marcel Holtmann <marcel@holtmann.org> writes:
> CC src/diff.o
> src/diff.c: In function ‘diff_common_add_diff_stat’:
> src/diff.c:191:22: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
> 191 | char *pipe = strchr(data, '|');
> | ^~~~~~
> ---
> src/diff.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/diff.c b/src/diff.c
> index 6c670e4b4fb4..182ea349eb9c 100644
> --- a/src/diff.c
> +++ b/src/diff.c
> @@ -188,7 +188,7 @@ diff_common_add_diff_stat(struct view *view, const char *text, size_t offset)
> const char *start = text + offset;
> const char *data = start + strspn(start, " ");
> size_t len = strlen(data);
> - char *pipe = strchr(data, '|');
> + const char *pipe = strchr(data, '|');
>
> /* Ensure that '|' is present and the file name part contains
> * non-space characters. */
Minor nit about the commit message, but this is due to a glibc-2.43
change. It isn't related to GCC versions.
Collin
next prev parent reply other threads:[~2026-04-17 16:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 16:12 [PATCH tig] Fix compiler warning with latest gcc Marcel Holtmann
2026-04-17 16:38 ` Collin Funk [this message]
2026-04-17 19:10 ` Marcel Holtmann
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pl3xsfrw.fsf@gmail.com \
--to=collin.funk1@gmail.com \
--cc=git@vger.kernel.org \
--cc=marcel@holtmann.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox