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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: mark got_privsep_exec_child as __dead
To:
Thomas Adam <thomas@xteddy.org>
Cc:
Omar Polo <op@omarpolo.com>, gameoftrees@openbsd.org
Date:
Sat, 18 Dec 2021 00:15:07 +0100

Download raw body.

Thread
On Fri, Dec 17, 2021 at 11:08:56PM +0000, Thomas Adam wrote:
> On Fri, Dec 17, 2021 at 11:37:59PM +0100, Stefan Sperling wrote:
> > 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?
> 
> It's not portable, but it just tells the compiler that the function does not
> return anything.  I rather like it, and it's a nice short-hand for the more
> verbose  __attribute__ ((__noreturn__))
> 
> I'd say, since it's already in there (and also used in a number of other
> OpenBSD projects), may as well keep using it where appropriate.

So __dead and __attribute__ ((__noreturn__)) are different from
a void return type, in the sense that they inform the compiler
that the program will stop its execution at the end of the function?

What is the advantage over just calling exit()?