Files
mirror_zfs/module/zfs
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
..
2022-02-15 08:58:59 -08:00
2021-06-07 09:02:47 -07:00
2022-03-04 16:25:22 -08:00
2020-08-20 10:30:06 -07:00
2019-07-26 10:54:14 -07:00
2019-06-19 09:48:12 -07:00
2021-05-27 14:27:29 -06:00
2022-01-26 11:38:52 -08:00
2022-03-04 16:25:22 -08:00
2022-01-26 11:38:52 -08:00
2020-11-02 11:51:12 -08:00
2022-03-04 16:25:22 -08:00
2022-03-04 16:25:22 -08:00
2022-01-26 11:38:52 -08:00
2022-02-18 09:34:03 -08:00
2022-01-26 11:38:52 -08:00
2022-01-26 11:38:52 -08:00
2022-01-26 11:38:52 -08:00
2022-02-18 09:34:03 -08:00
2022-02-03 14:28:19 -08:00
2022-02-18 09:34:03 -08:00
2022-01-14 15:37:55 -08:00
2022-01-07 10:36:49 -08:00
2022-01-12 16:14:36 -08:00
2022-01-07 10:36:49 -08:00
2022-01-26 11:38:52 -08:00
2022-03-04 16:25:22 -08:00
2022-01-26 11:38:52 -08:00
2019-06-19 09:48:12 -07:00
2020-07-29 16:35:33 -07:00
2022-01-14 15:37:55 -08:00
2022-02-18 09:34:03 -08:00
2020-06-18 12:21:25 -07:00
2022-01-26 11:38:52 -08:00
2022-02-18 09:34:03 -08:00
2022-01-26 11:38:52 -08:00
2022-01-26 11:38:52 -08:00
2022-03-04 16:25:22 -08:00
2021-06-22 21:53:45 -07:00
2022-03-04 16:25:22 -08:00
2019-10-09 10:36:03 -07:00
2022-01-26 11:38:52 -08:00
2022-01-04 16:46:32 -08:00
2022-01-26 11:38:52 -08:00
2022-01-26 11:38:52 -08:00
2022-01-26 11:38:52 -08:00
2022-01-26 11:38:52 -08:00
2020-11-13 13:51:51 -08:00
2022-01-26 11:38:52 -08:00
2020-10-02 17:44:10 -07:00
2022-02-18 09:34:03 -08:00
2022-02-18 09:34:03 -08:00
2022-02-18 09:34:03 -08:00
2022-02-22 13:06:43 -08:00
2022-02-18 09:34:03 -08:00
2020-06-18 12:21:25 -07:00
2020-06-18 12:21:18 -07:00
2022-03-04 16:25:22 -08:00
2022-02-18 09:34:03 -08:00