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:	Thu, 20 Jan 2011 18:44:38 +0300
From:	Denis Kirjanov <dkirjanov@...nel.org>
To:	Ingo Molnar <mingo@...e.hu>
CC:	linux-kernel@...r.kernel.org, a.p.zijlstra@...llo.nl,
	paulus@...ba.org, acme@...stprotocols.net
Subject: Re: [PATCH] perftools: Fix build error

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


Signed-off-by: Denis Kirjanov <dkirjanov@...nel.org>
---
 tools/perf/builtin-top.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 05344c6..a7bc50b 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -40,6 +40,7 @@
 #include <stdio.h>
 #include <termios.h>
 #include <unistd.h>
+#include <inttypes.h>
 
 #include <errno.h>
 #include <time.h>
@@ -537,7 +538,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("%" PRIu64, first->attr.sample_period);
 		if (freq)
 			printf("Hz ");
 		else
-- 
1.7.3.4

--
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