From 83838d5c1b8ca2efee52184136776c3cf7d5df2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 6 Nov 2011 13:06:23 +0100 Subject: cast variable in call to free() in builtin/diff.c and submodule.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- builtin/diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin') diff --git a/builtin/diff.c b/builtin/diff.c index 1118689fb2..0fe638fc45 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -182,7 +182,7 @@ static int builtin_diff_combined(struct rev_info *revs, 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; } -- cgit v1.2.3