From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1846 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: [PATCH] Add _Noreturn specifier to functions specified as such by ISO C11 Date: Thu, 6 Sep 2012 12:19:45 -0400 Message-ID: <20120906161945.GE27715@brightrain.aerifal.cx> References: <20120906031236.GZ27715@brightrain.aerifal.cx> <20120906160250.69b15b99@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1346948241 8064 80.91.229.3 (6 Sep 2012 16:17:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Sep 2012 16:17:21 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1847-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 06 18:17:23 2012 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 1T9ele-00067S-K2 for gllmg-musl@plane.gmane.org; Thu, 06 Sep 2012 18:17:22 +0200 Original-Received: (qmail 30683 invoked by uid 550); 6 Sep 2012 16:17:19 -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 30675 invoked from network); 6 Sep 2012 16:17:19 -0000 Content-Disposition: inline In-Reply-To: <20120906160250.69b15b99@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1846 Archived-At: On Thu, Sep 06, 2012 at 04:02:50PM +0200, philomath wrote: > Good, will do. > Other then thrd_exit (which is not yet implemented on musl), the patch I > sent adds _Noreturn to all such C11 functions. is the patch in good shape now? I think so. > Some ther functions that can use _Noreturn: > > pthread_exit, _exit, siglongjmp, _longjmp. Agree. > these are not specified in POSIX > with _Noreturn, neither will they be in the upcoming TC1. but that's not a That's because POSIX is aligned with C99 not C11, and C99 has no such thing as _Noreturn. Anyway, whether or not the function is declared with noreturn should not cause problems. > _start (the C version), __stack_chk_fail, __assert_fail, cleanup_fromsig. > non-standard functions. By _start do you mean the ldso function? That is not callable from C so there's no reason for it to be declared _Noreturn. Also, I think it would be wrong since the interface contract is NOT _Noreturn; it just happens that the stub implementation does not return. But the stub will never be used anyway. cleanup_fromsig has no use for _Noreturn, and in fact I'm not sure _Noreturn would be legal because pthread_cleanup_push does not take a pointer to a _Noreturn function. __stack_chk_fail is never called explicitly, so I don't think there's any use in _Noreturn on it. __assert_fail could definitely benefit from _Noreturn; it should give less bloat in code that uses assert. Rich