Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 6 Sep 2012 12:19:45 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: Re: [PATCH] Add _Noreturn specifier to functions
 specified as such by ISO C11

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

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.