Re: [PATCH 33/35] perf bench futex: Fix build on musl + clang

From: Arnaldo Carvalho de Melo
Date: Fri Sep 08 2017 - 09:48:05 EST


Em Fri, Sep 08, 2017 at 10:04:05AM +0200, Jörg Krause escreveu:
> On Mon, 2017-03-06 at 16:38 -0300, Arnaldo Carvalho de Melo wrote:
> > When building with clang on a musl libc system, Alpine Linux, we end up
> > hitting a problem where memset() is used but its prototype is not
> > present, add it to avoid this:

> > bench/futex-wake.c:99:3: error: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned long)'
> > [-Werror,-Wimplicit-function-declaration]
> > CPU_ZERO(&cpu);
> > ^
> > /usr/include/sched.h:127:23: note: expanded from macro 'CPU_ZERO'
> > #define CPU_ZERO(set) CPU_ZERO_S(sizeof(cpu_set_t),set)
> > ^
> > /usr/include/sched.h:110:30: note: expanded from macro 'CPU_ZERO_S'
> > #define CPU_ZERO_S(size,set) memset(set,0,size)
> > ^
> > bench/futex-wake.c:99:3: note: include the header <string.h> or explicitly provide a declaration for 'memset'

> In my opinion the musl <shed.h> header file should include <string.h>.

Agreed.

> I've reported the issue to the musl mailing list:

> http://www.openwall.com/lists/musl/2017/09/08/1

Thanks for reporting that to them,

- Arnaldo