LKML Archive on
 help / color / Atom feed
From: Arnaldo Carvalho de Melo <>
To: Ben Hutchings <>
Cc: Peter Zijlstra <>,
	Ingo Molnar <>,
	Alexander Shishkin <>,
	Jiri Olsa <>, Namhyung Kim <>,
Subject: Re: [PATCH] perf tools: Suppress potential format-truncation warning in util/pmu.c
Date: Mon, 12 Nov 2018 08:37:20 -0800
Message-ID: <> (raw)
In-Reply-To: <>

Em Sun, Nov 11, 2018 at 06:45:24PM +0000, Ben Hutchings escreveu:
> Depending on which functions are inlined in util/pmu.c, the
> snprintf() calls in perf_pmu__parse_{scale,unit,per_pkg,snapshot}()
> might trigger a warning:
> util/pmu.c: In function 'pmu_aliases':
> util/pmu.c:178:31: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
>   snprintf(path, PATH_MAX, "%s/%s.unit", dir, name);
>                                ^~
> I found this when trying to build perf from Linux 3.16 with gcc 8.
> However I can reproduce the problem in mainline if I force
> __perf_pmu__new_alias() to be inlined.
> Suppress this by using scnprintf() as has been done elsewhere in
> perf.

Thanks, applied.

- Arnaldo

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 18:45 Ben Hutchings
2018-11-12 16:37 ` Arnaldo Carvalho de Melo [this message]
2018-11-22  7:13 ` [tip:perf/core] perf pmu: Suppress potential format-truncation warning tip-bot for Ben Hutchings

Reply instructions:

You may reply publically 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:

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

  git send-email \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox