summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 473f4c9)
raw | patch | inline | side by side (parent: 473f4c9)
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Sun, 6 Nov 2011 12:06:23 +0000 (13:06 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 6 Nov 2011 18:43:18 +0000 (10:43 -0800) |
Both of these free() calls are freeing a "const unsigned char (*)[20]"
type while free() expects a "void *". This results in the following
warning under clang 2.9:
builtin/diff.c:185:7: warning: passing 'const unsigned char (*)[20]' to parameter of type 'void *' discards qualifiers
free(parent);
^~~~~~
submodule.c:394:7: warning: passing 'const unsigned char (*)[20]' to parameter of type 'void *' discards qualifiers
free(parents);
^~~~~~~
This free()-ing without a cast was added by Jim Meyering to
builtin/diff.c in v1.7.6-rc3~4 and later by Fredrik Gustafsson in
submodule.c in v1.7.7-rc1~25^2.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
type while free() expects a "void *". This results in the following
warning under clang 2.9:
builtin/diff.c:185:7: warning: passing 'const unsigned char (*)[20]' to parameter of type 'void *' discards qualifiers
free(parent);
^~~~~~
submodule.c:394:7: warning: passing 'const unsigned char (*)[20]' to parameter of type 'void *' discards qualifiers
free(parents);
^~~~~~~
This free()-ing without a cast was added by Jim Meyering to
builtin/diff.c in v1.7.6-rc3~4 and later by Fredrik Gustafsson in
submodule.c in v1.7.7-rc1~25^2.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/diff.c | patch | blob | history | |
submodule.c | patch | blob | history |
diff --git a/builtin/diff.c b/builtin/diff.c
index 1118689fb246b864ce758039543327c4304cdaa4..0fe638fc45c780e53901b8be22d3b4d715be3c30 100644 (file)
--- a/builtin/diff.c
+++ b/builtin/diff.c
hashcpy((unsigned char *)(parent + i), ent[i].item->sha1);
diff_tree_combined(parent[0], parent + 1, ents - 1,
revs->dense_combined_merges, revs);
- free(parent);
+ free((void *)parent);
return 0;
}
diff --git a/submodule.c b/submodule.c
index ad86534ba1e1e1726fd6427c65182ba954957904..09181ff6e575d5aa5e2fa850bc794fac5953587d 100644 (file)
--- a/submodule.c
+++ b/submodule.c
@@ -385,7 +385,7 @@ static void commit_need_pushing(struct commit *commit, struct commit_list *paren
rev.diffopt.format_callback_data = needs_pushing;
diff_tree_combined(commit->object.sha1, parents, n, 1, &rev);
- free(parents);
+ free((void *)parents);
}
int check_submodule_needs_pushing(unsigned char new_sha1[20], const char *remotes_name)