From 7d16c634233c411f54b89d0f1d51750dc85c5f7e Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Thu, 9 Jan 2014 23:07:59 +0900 Subject: perf tools: Fix build error due to zfree() cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It failed to build perf on my ubuntu 10.04 box (gcc 4.4.3): CC util/strlist.o cc1: warnings being treated as errors util/strlist.c: In function ‘str_node__delete’: util/strlist.c:42: error: dereferencing type-punned pointer will break strict-aliasing rules util/strlist.c:42: error: dereferencing type-punned pointer will break strict-aliasing rules CC util/strfilter.o make: *** [util/strlist.o] Error 1 CC util/srcline.o cc1: warnings being treated as errors util/srcline.c: In function ‘addr2line_init’: util/srcline.c:132: error: dereferencing type-punned pointer will break strict-aliasing rules util/srcline.c:132: error: dereferencing type-punned pointer will break strict-aliasing rules util/srcline.c: In function ‘addr2line_cleanup’: util/srcline.c:143: error: dereferencing type-punned pointer will break strict-aliasing rules util/srcline.c:143: error: dereferencing type-punned pointer will break strict-aliasing rules make: *** [util/srcline.o] Error 1 It seems it only allows to remove 'const' qualifier. Signed-off-by: Namhyung Kim Cc: Ingo Molnar Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1389276479-9047-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/strlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/perf/util/strlist.c') diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c index 61a90bf24b4d..71f9d102b96f 100644 --- a/tools/perf/util/strlist.c +++ b/tools/perf/util/strlist.c @@ -39,7 +39,7 @@ out_delete: static void str_node__delete(struct str_node *snode, bool dupstr) { if (dupstr) - zfree((void **)&snode->s); + zfree((char **)&snode->s); free(snode); } -- cgit v1.2.1