mirror_zfs/module
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
..
avl Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
icp module: icp: remove useless assert 2022-02-18 09:34:18 -08:00
lua Use _Noreturn (C11; GNU89) properly 2022-03-04 16:25:22 -08:00
nvpair module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
os log xattr=sa create/remove/update to ZIL 2022-02-22 13:06:43 -08:00
spl Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
unicode module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zcommon Flex non-pretty-printed properties and raw-/pretty-print remaining ones 2022-03-04 12:08:33 -08:00
zfs Use _Noreturn (C11; GNU89) properly 2022-03-04 16:25:22 -08:00
zstd Re-apply 6ba2e72b, silence lint 2022-03-01 13:56:00 -08:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in Add zstd support to zfs 2020-08-20 10:30:06 -07:00
Makefile.bsd Explode zstd 1.4.5 into separate upstream files 2022-03-01 13:55:12 -08:00
Makefile.in Re-apply 6ba2e72b, silence lint 2022-03-01 13:56:00 -08:00