aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-01-09 09:07:59 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-01-15 13:10:04 -0500
commit7d16c634233c411f54b89d0f1d51750dc85c5f7e (patch)
tree6e00bbe2f05188b5d87d33b2a4549a224a3c1a43 /tools
parenta6205a35ba2d56dcfb79b08cc11b8c7d549826aa (diff)
perf tools: Fix build error due to zfree() cast
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 <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1389276479-9047-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/srcline.c4
-rw-r--r--tools/perf/util/strlist.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index 7e67879ebd25..f3e4bc5fe5d2 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -129,7 +129,7 @@ static struct a2l_data *addr2line_init(const char *path)
129 129
130out: 130out:
131 if (a2l) { 131 if (a2l) {
132 zfree((void **)&a2l->input); 132 zfree((char **)&a2l->input);
133 free(a2l); 133 free(a2l);
134 } 134 }
135 bfd_close(abfd); 135 bfd_close(abfd);
@@ -140,7 +140,7 @@ static void addr2line_cleanup(struct a2l_data *a2l)
140{ 140{
141 if (a2l->abfd) 141 if (a2l->abfd)
142 bfd_close(a2l->abfd); 142 bfd_close(a2l->abfd);
143 zfree((void **)&a2l->input); 143 zfree((char **)&a2l->input);
144 zfree(&a2l->syms); 144 zfree(&a2l->syms);
145 free(a2l); 145 free(a2l);
146} 146}
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:
39static void str_node__delete(struct str_node *snode, bool dupstr) 39static void str_node__delete(struct str_node *snode, bool dupstr)
40{ 40{
41 if (dupstr) 41 if (dupstr)
42 zfree((void **)&snode->s); 42 zfree((char **)&snode->s);
43 free(snode); 43 free(snode);
44} 44}
45 45