lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 21 Jan 2011 16:53:37 -0200
From:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To:	Denis Kirjanov <dkirjanov@...nel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	a.p.zijlstra@...llo.nl, paulus@...ba.org
Subject: Re: [PATCH] perftools: Fix build error

Em Thu, Jan 20, 2011 at 06:44:38PM +0300, Denis Kirjanov escreveu:
> On 01/20/2011 02:47 PM, Ingo Molnar wrote:
> > 
> > * Denis Kirjanov <dkirjanov@...nel.org> wrote:
> > 
> >> Fix perftools build error (ppc64 box) with PERF_VERSION = 2.6.38.rc1.47.g12fcdb
> >> CC builtin-top.o
> >> cc1: warnings being treated as errors
> >> builtin-top.c: In function 'print_sym_table':
> >> builtin-top.c:540: error: format '%Ld' expects type 'long long int', but argument 2 has type '__u64'
> >>
> >> Signed-off-by: Denis Kirjanov <dkirjanov@...nel.org>
> >> ---
> >>  tools/perf/builtin-top.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> >> index 05344c6..8202a2e 100644
> >> --- a/tools/perf/builtin-top.c
> >> +++ b/tools/perf/builtin-top.c
> >> @@ -537,7 +537,7 @@ static void print_sym_table(void)
> >>  	if (nr_counters == 1 || !display_weighted) {
> >>  		struct perf_evsel *first;
> >>  		first = list_entry(evsel_list.next, struct perf_evsel, node);
> >> -		printf("%Ld", first->attr.sample_period);
> >> +		printf("%Ld", (unsigned long long)first->attr.sample_period);
> > 
> > Wouldnt %Lu solve this in a cleaner way?
> > 
> > Thanks,
> > 
> > 	Ingo
> > 
> I think that cleaner way is to use PRIu64.
> 
> 
> >From 492bf54effdf8c154e76c4ca734f27ce1db46df6 Mon Sep 17 00:00:00 2001
> From: Denis Kirjanov <dkirjanov@...nel.org>
> Date: Thu, 20 Jan 2011 18:34:56 +0300
> Subject: [PATCH] perftools: Fix build error
> 
>     CC perf.o
>     CC builtin-top.o
> cc1: warnings being treated as errors
> builtin-top.c: In function 'print_sym_table':
> builtin-top.c:540: error: format '%Ld' expects type 'long long int', but argument 2 has type '__u64'
> make: *** [builtin-top.o] Error 1


Now, after applying your patch, I get:

[acme@...icio linux]$ make -j2 O=~acme/git/build/perf -C tools/perf/ install
make: Entering directory `/media/tbs/acme/git/linux/tools/perf'
    GEN perf-archive
    CC /home/acme/git/build/perf/builtin-top.o
cc1: warnings being treated as errors
builtin-top.c: In function ‘print_sym_table’:
builtin-top.c:541:3: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 2 has type ‘__u64’
make: *** [/home/acme/git/build/perf/builtin-top.o] Error 1
make: Leaving directory `/media/tbs/acme/git/linux/tools/perf'




[acme@...icio linux]$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.5.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC) 
[acme@...icio linux]$ cat /etc/fedora-release 
Fedora release 14 (Laughlin)
[acme@...icio linux]$ 

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ