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

[PATCH 1/3] git.c: Kill type mismatch warning.

From
MWMark Wooding <mdw@distorted.org.uk>
Date
Mar 5, 2006, 09:36 UTC
Message-ID
<20060305093630.26650.91571.stgit@metalzone.distorted.org.uk>
In-Reply-To
<20060305093351.26650.84677.stgit@metalzone.distorted.org.uk>
From: Mark Wooding <mdw@distorted.org.uk>

GCC objects when you pass a `char **' where a `const char **' is wanted. The cast shuts the compiler up, and does the right thing generally.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
---

Unfortunately, the warning is fair enough. I can pass a `T' where someone was expecting a `const T', but that would mean that the callee was expecting a `char *const *'. ---

 git.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git.c b/git.c
index a547dbd..69df070 100644
--- a/git.c
+++ b/git.c
@@ -261,7 +261,7 @@ static int cmd_log(int argc, char **argv
 	int show_parents = 0;
 	const char *commit_prefix = "commit ";
 
-	argc = setup_revisions(argc, argv, &rev, "HEAD");
+	argc = setup_revisions(argc, (const char **)argv, &rev, "HEAD");
 	while (1 < argc) {
 		char *arg = argv[1];
 		if (!strncmp(arg, "--pretty", 8)) {
Previous: Mark WoodingNext: Mark Wooding
Message 2 of 4 in “Build fixes for v1.2.4-gc9e9f1a”
  1. 0/3 Build fixes for v1.2.4-gc9e9f1aMark Wooding, Mar 5, 2006
  2. 1/3 git.c: Kill type mismatch warning.Mark Wooding, Mar 5, 2006
  3. 2/3 Documentation/Makefile: Some `git-*.txt' files aren't manpages.Mark Wooding, Mar 5, 2006
  4. 3/3 Documentation/git-cvsserver.txt: Fix list numbering.Mark Wooding, Mar 5, 2006

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.