Files
mirror_zfs/lib/libspl/include/sys
Alejandro Colomar db7f1a91de Use _Noreturn (C11; GNU89) properly
A function that returns with no value is a different thing from a
function that doesn't return at all.  Those are two orthogonal
concepts, commonly confused.

pthread_create(3) expects a pointer to a start routine that has a
very precise prototype:

    void *(*start_routine)(void *);

However, other thread functions, such as kernel ones, expect:

    void (*start_routine)(void *);

Providing a different one is incorrect, and has only been working
because the ABIs happen to produce a compatible function.

We should use '_Noreturn void', since it's the natural type, and
then provide a '_Noreturn void *' wrapper for pthread functions.

For consistency, replace most cases of __NORETURN or
__attribute__((noreturn)) by _Noreturn.  _Noreturn is understood
by -std=gnu89, so it should be safe to use everywhere.

Ref: https://github.com/openzfs/zfs/pull/13110#discussion_r808450136
Ref: https://software.codidact.com/posts/285972
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Closes #13120
2022-03-04 16:25:22 -08:00
..
2020-06-24 18:20:18 -07:00
2010-08-31 13:41:59 -07:00
2020-10-13 21:25:48 -07:00
2013-12-18 16:46:35 -08:00
2013-12-18 16:46:35 -08:00
2013-12-18 16:46:35 -08:00
2021-03-22 12:34:58 -07:00
2013-12-18 16:46:35 -08:00
2013-12-18 16:46:35 -08:00
2013-12-18 16:46:35 -08:00
2021-06-10 08:27:33 -07:00
2010-08-31 13:41:59 -07:00
2021-05-27 14:27:29 -06:00
2010-08-31 13:41:59 -07:00
2013-12-18 16:46:35 -08:00
2013-12-18 16:46:35 -08:00
2013-12-18 16:46:35 -08:00
2022-02-18 09:34:08 -08:00
2013-12-18 16:46:35 -08:00
2018-05-29 16:00:33 -07:00
2018-05-29 16:00:33 -07:00
2013-12-18 16:46:35 -08:00
2010-08-31 13:41:59 -07:00
2017-08-09 15:31:08 -07:00
2020-02-27 09:31:02 -08:00
2018-05-29 16:00:33 -07:00
2018-05-29 16:00:33 -07:00
2010-08-31 13:41:59 -07:00
2021-01-20 21:27:30 -08:00
2014-08-13 10:35:00 -07:00
2013-12-18 16:46:35 -08:00
2013-12-18 16:46:35 -08:00
2019-09-02 17:53:27 -07:00
2021-05-27 14:27:29 -06:00
2013-12-18 16:46:35 -08:00