[PATCH 1/3] git.c: Kill type mismatch warning.
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(-)
Show changes to git.c +1 −1
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)) {