2015-04-24 00:38:54

by Vinson Lee

[permalink] [raw]
Subject: 4.0-rc1 perf build error "builtin-kmem.c:322: error: declaration of ‘stat’ shadows a global declaration"

Hi.

4.0-rc1 commit 0d68bc92c48167130b61b449f08be27dc862dba2 "perf kmem:
Analyze page allocator events also" introduced a build error with
older toolchains.

For example, this build errors occurs on CentOS 6.

CC builtin-kmem.o
cc1: warnings being treated as errors
builtin-kmem.c: In function ‘search_page_alloc_stat’:
builtin-kmem.c:322: error: declaration of ‘stat’ shadows a global declaration
/usr/include/sys/stat.h:455: error: shadowed declaration is here
builtin-kmem.c: In function ‘perf_evsel__process_page_alloc_event’:
builtin-kmem.c:378: error: declaration of ‘stat’ shadows a global declaration
/usr/include/sys/stat.h:455: error: shadowed declaration is here
builtin-kmem.c: In function ‘perf_evsel__process_page_free_event’:
builtin-kmem.c:431: error: declaration of ‘stat’ shadows a global declaration
/usr/include/sys/stat.h:455: error: shadowed declaration is here

Cheers,
Vinson


2015-04-24 13:54:54

by David Ahern

[permalink] [raw]
Subject: Re: 4.0-rc1 perf build error "builtin-kme m.c:322: error: declaration of ‘stat’ shado ws a global declaration"

On 4/23/15 6:38 PM, Vinson Lee wrote:
> Hi.
>
> 4.0-rc1 commit 0d68bc92c48167130b61b449f08be27dc862dba2 "perf kmem:
> Analyze page allocator events also" introduced a build error with
> older toolchains.
>
> For example, this build errors occurs on CentOS 6.
>
> CC builtin-kmem.o
> cc1: warnings being treated as errors
> builtin-kmem.c: In function ‘search_page_alloc_stat’:
> builtin-kmem.c:322: error: declaration of ‘stat’ shadows a global declaration
> /usr/include/sys/stat.h:455: error: shadowed declaration is here
> builtin-kmem.c: In function ‘perf_evsel__process_page_alloc_event’:
> builtin-kmem.c:378: error: declaration of ‘stat’ shadows a global declaration
> /usr/include/sys/stat.h:455: error: shadowed declaration is here
> builtin-kmem.c: In function ‘perf_evsel__process_page_free_event’:
> builtin-kmem.c:431: error: declaration of ‘stat’ shadows a global declaration
> /usr/include/sys/stat.h:455: error: shadowed declaration is here

Fixed in Arnaldo's core branch; he will push to urgent and Ingo soon.

David