linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Richter <tmricht@linux.ibm.com>
To: Namhyung Kim <namhyung@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-perf-users <linux-perf-users@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Sven Schnelle <svens@linux.ibm.com>,
	gor@linux.ibm.com, sumanthk@linux.ibm.com,
	Heiko Carstens <hca@linux.ibm.com>
Subject: Re: [PATCH] perf/s390: Compiler error on s390 for bench/numa.c
Date: Fri, 20 May 2022 08:55:04 +0200	[thread overview]
Message-ID: <77e8b080-e7fc-fc06-a8e7-57ca30f6d0fe@linux.ibm.com> (raw)
In-Reply-To: <CAM9d7cjjSk-qyA+ZF2YyrJUeaPN8wi7yDzu+ZRbiM4BhjFvg1A@mail.gmail.com>

On 5/19/22 23:45, Namhyung Kim wrote:
> On Thu, May 19, 2022 at 9:27 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
>>
>> The compilation on s390 results in this error:
>>
>>  # make DEBUG=y bench/numa.o
>>  ...
>>  bench/numa.c: In function ‘__bench_numa’:
>>  bench/numa.c:1749:81: error: ‘%d’ directive output may be truncated
>>              writing between 1 and 11 bytes into a region of size between
>>              10 and 20 [-Werror=format-truncation=]
>>  1749 |        snprintf(tname, sizeof(tname), "process%d:thread%d", p, t);
>>                                                                ^~
>>  ...
>>  bench/numa.c:1749:64: note: directive argument in the range
>>                 [-2147483647, 2147483646]
>>  ...
>>  #
>>
>> The maximum length of the %d replacement is 11 characters because
>> of the negative sign.  Therefore use %u as format conversion.
> 
> But their type is int and I'm afraid some compilers might complain
> about it.  Why not just increase the buffer size?
> 
> Thanks,
> Namhyung
> 
> 


Sure fine with me, I will send v2 and increase the array size.

Thanks
-- 
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

      reply	other threads:[~2022-05-20  6:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19  8:55 [PATCH] perf/s390: Compiler error on s390 for bench/numa.c Thomas Richter
2022-05-19 21:45 ` Namhyung Kim
2022-05-20  6:55   ` Thomas Richter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77e8b080-e7fc-fc06-a8e7-57ca30f6d0fe@linux.ibm.com \
    --to=tmricht@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=sumanthk@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).