From patchwork Thu Jan 24 05:44:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2] perf tools, powerpc: Fix compile warnings in tests/attr.c Date: Wed, 23 Jan 2013 19:44:39 -0000 From: sukadev@linux.vnet.ibm.com X-Patchwork-Id: 215249 Message-Id: <20130124054439.GA31588@us.ibm.com> To: Arnaldo Carvalho de Melo Cc: linuxppc-dev@ozlabs.org, ellerman@au1.ibm.com, Anton Blanchard , Jiri Olsa , linux-kernel@vger.kernel.org [PATCH][v2] perf tools, powerpc: Fix compile warnings in tests/attr.c We print several '__u64' quantities using '%llu'. On powerpc, we by default include ' which results in __u64 being an unsigned long. This causes compile warnings which are treated as errors due to '-Werror'. By defining __SANE_USERSPACE_TYPES__ we include and define __u64 as unsigned long long. Changelog[v2]: [Michael Ellerman] Use __SANE_USERSPACE_TYPES__ and avoid PRIu64 format specifier - which as Jiri Olsa pointed out, breaks on x86-64. Signed-off-by: Sukadev Bhattiprolu --- tools/perf/tests/attr.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c index f61dd3f..bdcceb8 100644 --- a/tools/perf/tests/attr.c +++ b/tools/perf/tests/attr.c @@ -19,6 +19,11 @@ * permissions. All the event text files are stored there. */ +/* + * Powerpc needs __SANE_USERSPACE_TYPES__ before to select + * 'int-ll64.h' and avoid compile warnings when printing __u64 with %llu. + */ +#define __SANE_USERSPACE_TYPES__ #include #include #include