"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: mark got_privsep_exec_child as __dead
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 17 Dec 2021 23:56:27 +0100

Download raw body.

Thread
Stefan Sperling <stsp@stsp.name> writes:

> On Fri, Dec 17, 2021 at 08:30:25PM +0100, Omar Polo wrote:
>> Hello,
>> 
>> this caught my eye, there's a reason got_privsep_exec_child is not
>> marked as __dead?  it reads slightly better IMHO.
>
> I rarely used symbols that start with two underscores.
> As far as I know they are not something one should use.
>
> I am aware that __dead is used in got/got.c already.
> But that was mpi@, it wasn't me.
>
> Is __dead widely supported? What exactly does it imply?

__dead is #define'd to __attribute__((noreturn)) to indicate that a
function doesn't return.  AFAIK that's not portable, and got-portable
deals with it with something along the lines of

#ifndef __dead
#define __dead __attribute__((noreturn))
#endif

I saw it was used and that was the reason for the diff, but not checked
who commit what.  Anyway, this is just bikeshedding from my part, I'm
not attached to that diff, feel free to discard it.

Thanks naddy@ for the explanation thought!  (I should have know that the
compiler can't guess the size since it's vararg, just not thought about
it.)