summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2011-11-06 12:06:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-11-06 18:43:18 (GMT)
commit83838d5c1b8ca2efee52184136776c3cf7d5df2f (patch)
treec81f344ab112142f34dacf9d205f5aca58c32382 /submodule.c
parent473f4c96e315478185c4a07d6e7fb65801ee40b9 (diff)
downloadgit-83838d5c1b8ca2efee52184136776c3cf7d5df2f.zip
git-83838d5c1b8ca2efee52184136776c3cf7d5df2f.tar.gz
git-83838d5c1b8ca2efee52184136776c3cf7d5df2f.tar.bz2
cast variable in call to free() in builtin/diff.c and submodule.c
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>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/submodule.c b/submodule.c
index ad86534..09181ff 100644
--- 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)