Re: [PATCH] kselftest: Mark functions that unconditionally call exit() as __noreturn

From: Thomas Gleixner
Date: Fri Apr 12 2024 - 08:05:57 EST


On Thu, Apr 11 2024 at 11:45, Nathan Chancellor wrote:
> I have based this change on timers/urgent, as the commit that introduces
> this particular warning is there and it is marked for stable, even
> though this appears to be a generic kselftest issue. I think it makes
> the most sense for this change to go via timers/urgent with Shuah's ack.
> While __noreturn with a return type other than 'void' does not make much
> sense semantically, there are many places that these functions are used
> as the return value for other functions such as main(), so I did not
> change the return type of these functions from 'int' to 'void' to
> minimize the necessary changes for a backport (it is an existing issue
> anyways).

Hrmm. This really want's to be fixed once the change hits Linus tree as this:

static inline __noreturn int ksft_exit_pass(void)

looks seriously broken :)