Git development
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: git@vger.kernel.org
Cc: Marcel Holtmann <marcel@holtmann.org>
Subject: [PATCH tig] Fix compiler warning with latest gcc
Date: Fri, 17 Apr 2026 18:12:28 +0200	[thread overview]
Message-ID: <20260417161228.1578-1-marcel@holtmann.org> (raw)

        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. */
-- 
2.53.0


             reply	other threads:[~2026-04-17 16:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17 16:12 Marcel Holtmann [this message]
2026-04-17 16:38 ` [PATCH tig] Fix compiler warning with latest gcc Collin Funk
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=20260417161228.1578-1-marcel@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=git@vger.kernel.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