From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4828 Path: news.gmane.org!not-for-mail From: Abdoulaye Walsimou Gaye Newsgroups: gmane.linux.lib.musl.general Subject: Re: build with clang-3.4 warnings report Date: Mon, 07 Apr 2014 21:40:52 +0200 Message-ID: <5342FF44.9060108@embtoolkit.org> References: <533F0F1A.6040707@embtoolkit.org> <20140404204701.GO26358@brightrain.aerifal.cx> <533F56FB.8060509@embtoolkit.org> <20140405015443.GU26358@brightrain.aerifal.cx> <53428963.9030609@f-prot.com> <20140407172334.GC26358@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1396899662 23690 80.91.229.3 (7 Apr 2014 19:41:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2014 19:41:02 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4832-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 07 21:40:55 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WXFPZ-00020N-8D for gllmg-musl@plane.gmane.org; Mon, 07 Apr 2014 21:40:53 +0200 Original-Received: (qmail 21874 invoked by uid 550); 7 Apr 2014 19:40:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21866 invoked from network); 7 Apr 2014 19:40:50 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <20140407172334.GC26358@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:4828 Archived-At: On 04/07/2014 07:23 PM, Rich Felker wrote: > On Mon, Apr 07, 2014 at 11:17:55AM +0000, Oliver Schneider wrote: >> On 2014-04-05 01:54, Rich Felker wrote: >>>> 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). >> There is yet another possibility ;) >> >> The ccc-analyzer could simply be buggy in this case. Would be >> interesting to look at the optimized intermediate code whether this gets >> optimized out. I think it probably doesn't, but who knows. > At one point it was getting optimized out, which made it impossible to > build musl with clang, so I think this was fixed and it's just a > residual bug in the warning generation. > >> The dangling else warnings could also be resolved by simply adding >> braces. It doesn't add to the code size, and the times when developers >> where paid by LoC are long over (I hope). > Hello, I can confirm that these functions are not optimized out by clang, here is __init_security.o example 16: 00000000 4 FUNC LOCAL DEFAULT 1 dummy 17: 00000000 24 OBJECT LOCAL DEFAULT 22 .L__init_security.pfd 18: 00000000 10 OBJECT LOCAL DEFAULT 23 .L.str 19: 00000000 0 SECTION LOCAL DEFAULT 22 20: 00000000 0 NOTYPE LOCAL DEFAULT 22 $d 21: 00000000 0 SECTION LOCAL DEFAULT 23 22: 00000000 0 SECTION LOCAL DEFAULT 24 23: 00000000 0 SECTION LOCAL DEFAULT 25 24: 00000000 0 SECTION LOCAL DEFAULT 26 25: 00000004 208 FUNC GLOBAL DEFAULT 1 __init_security 26: 00000000 4 FUNC WEAK DEFAULT 1 __init_ssp 27: 00000000 0 NOTYPE GLOBAL DEFAULT UND __syscall 28: 00000000 0 NOTYPE GLOBAL DEFAULT UND __libc - awg