lkml.org 
[lkml]   [2020]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tools/perf/util/*.c: Use "%zd" output format for size_t type
On 2020/2/26 7:02, Joe Perches wrote:
> On Tue, 2020-02-25 at 14:39 +0800, Xiao Yang wrote:
>> Avoid the following errors when building perf:
>> -----------------------------------------------
>> util/session.c: In function 'perf_session__process_compressed_event':
>> util/session.c:91:11: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t {aka unsigned int}' [-Werror=format=]
>> pr_debug("decomp (B): %ld to %ld\n", src_size, decomp_size);
> []
>> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> []
>> @@ -88,7 +88,7 @@ static int perf_session__process_compressed_event(struct perf_session *session,
>> session->decomp_last = decomp;
>> }
>>
>> - pr_debug("decomp (B): %ld to %ld\n", src_size, decomp_size);
>> + pr_debug("decomp (B): %zd to %zd\n", src_size, decomp_size);
> likely better as %zu, etc...
Hi,

Sorry, %zu is obvious better.
I will send v2 patch shortly.

Thanks,
Xiao Yang
>
>
>
> .
>



\
 
 \ /
  Last update: 2020-02-26 02:03    [W:0.087 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site