|
|
Message-ID: <20140405015443.GU26358@brightrain.aerifal.cx>
Date: Fri, 4 Apr 2014 21:54:43 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: build with clang-3.4 warnings report
On Sat, Apr 05, 2014 at 03:06:03AM +0200, Abdoulaye Walsimou Gaye wrote:
> OK I was not building with --enable-warnings! Here is another round without bogus warnings you rejected:
> -Wstring-plus-int
> -Wtautological-constant-out-of-range-compare
>
> Thanks,
> awg
>
> src/aio/aio_readwrite.c:20:16: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
> .__si_fields.__sigchld.si_pid = __pthread_self()->pid,
> ~^~~~~~~~~
> src/aio/aio_readwrite.c:18:20: note: previous initialization is here
> .__si_fields.__rt.si_sigval = sev->sigev_value,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> src/aio/aio_readwrite.c:8:13: warning: function 'dummy' is not needed and will not be emitted [-Wunneeded-internal-declaration]
> static void dummy(void)
> ^
> 2 warnings generated.
Like I said before, this looks real, and we need to look into it.
> src/env/__init_security.c:8:13: warning: function 'dummy' is not needed and will not be emitted [-Wunneeded-internal-declaration]
> static void dummy(void *ent)
> ^
> 1 warning generated.
This is a bug in the compiler; the function dummy has an externally
visible alias, so it will not be omitted (and if it is actually
omitted, that means the compiler is generating broken output).
> src/env/__init_tls.c:46:14: warning: function 'simple' is not needed and will not be emitted [-Wunneeded-internal-declaration]
> static void *simple(void *p)
> ^
> 1 warning generated.
Thanks! This is a great find, cruft that was left behind in the lazy
thread pointer init removal. Fixing it shaved ~40 bytes off the
minimal static-linked program size, bringing the net change from the
change down to near-zero if I'm not mistaken. :-) Our anti-bloat
extremists will be very happy.
> src/env/__libc_start_main.c:9:13: warning: function 'dummy' is not needed and will not be emitted [-Wunneeded-internal-declaration]
> static void dummy() {}
> ^
> 1 warning generated.
Another false positive.
> In file included from src/errno/strerror.c:7:
> src/errno/__strerror.h:100:1: warning: implicit conversion from 'int' to 'unsigned char' changes value from 1133 to 109 [-Wconstant-conversion]
> 1133,
> ^~~~
> 1 warning generated.
Again, I'm confused why we're getting this one.
> src/regex/regcomp.c:3123:18: warning: explicitly assigning a variable of type 'reg_errcode_t' (aka 'int') to itself [-Wself-assign]
> do { errcode = errcode; if ( 1) goto error_exit; } while ( 0);
> ~~~~~~~ ^ ~~~~~~~
This is gratuitous and comes from a macro expansion.
The rest are more duplicates of the weak alias false positive (unused
static functions).
Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.