mirror_zfs/lib/libuutil
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
..
libuutil.abi Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
libuutil.suppr Library ABI tracking with abigail 2020-11-17 09:18:52 -08:00
Makefile.am libuutil: purge unused functions 2021-04-12 09:32:43 -07:00
uu_alloc.c Update to onnv_147 2010-08-26 14:24:34 -07:00
uu_avl.c Fix a resource leak in uu_avl_pool_destroy 2021-01-26 19:39:28 -08:00
uu_ident.c Fix gcc ident pragma warnings 2010-08-27 15:34:02 -07:00
uu_list.c Fix gcc ident pragma warnings 2010-08-27 15:34:02 -07:00
uu_misc.c libuutil: purge unused functions 2021-04-12 09:32:43 -07:00
uu_pname.c Use _Noreturn (C11; GNU89) properly 2022-03-04 16:25:22 -08:00
uu_string.c Remove unused headers from uu_string.c 2019-10-25 13:53:50 -07:00