Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1371219

Re: [PATCH] perf config: Fix build with older toolchain.

From Taeung Song <taeung.dev@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] perf config: Fix build with older toolchain.
Date 2016-04-05 07:30 +0200
Message-ID <rkrIS-6Ag-13@gated-at.bofh.it> (permalink)
References <rkkR4-1n3-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On 04/05/2016 07:07 AM, Vinson Lee wrote:
> Fix build error on Ubuntu 12.04.5 with GCC 4.6.3.
>
>    CC       util/config.o
> util/config.c: In function ‘perf_buildid_config’:
> util/config.c:384:15: error: declaration of ‘dirname’ shadows a global declaration [-Werror=shadow]

I'm sorry, lately I added perf_buildid_config() but I didn't test by 
gcc-4.6.3

> Fixes: 9cb5987c8227 ("perf config: Rework buildid_dir_command_config to perf_buildid_config")
> Signed-off-by: Vinson Lee <vlee@freedesktop.org>
> ---
>   tools/perf/util/config.c |    6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
> index 5c20d783423b..a3d80a05e7a2 100644
> --- a/tools/perf/util/config.c
> +++ b/tools/perf/util/config.c
> @@ -381,11 +381,11 @@ static int perf_buildid_config(const char *var, const char *value)
>   {
>   	/* same dir for all commands */
>   	if (!strcmp(var, "buildid.dir")) {
> -		const char *dirname = perf_config_dirname(var, value);
> +		const char *v = perf_config_dirname(var, value);

Why you use 'v' variable name ?

'v' variable name was used in set_buildid_dir(), too.
But I send a patch renaming 'v' to 'home' because 'home' is more readable.
37194f4 ("perf config: Rename 'v' to 'home' in set_buildid_dir()")
https://lkml.org/lkml/2016/3/27/98

IMHO, I like using 'dir' instead of 'v'.


Thanks,
Taeung

>
> -		if (!dirname)
> +		if (!v)
>   			return -1;
> -		strncpy(buildid_dir, dirname, MAXPATHLEN-1);
> +		strncpy(buildid_dir, v, MAXPATHLEN-1);
>   		buildid_dir[MAXPATHLEN-1] = '\0';
>   	}
>
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] perf config: Fix build with older toolchain. Vinson Lee <vlee@freedesktop.org> - 2016-04-05 00:10 +0200
  Re: [PATCH] perf config: Fix build with older toolchain. Taeung Song <taeung.dev@gmail.com> - 2016-04-05 07:30 +0200
    Re: [PATCH] perf config: Fix build with older toolchain. Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-05 15:40 +0200
      Re: [PATCH] perf config: Fix build with older toolchain. Taeung Song <treeze.taeung@gmail.com> - 2016-04-05 15:50 +0200
  Re: [PATCH] perf config: Fix build with older toolchain. Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-05 15:40 +0200
  [tip:perf/core] perf config: Fix build with older toolchain. tip-bot for Vinson Lee <tipbot@zytor.com> - 2016-04-13 09:20 +0200

csiph-web