"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:
Theo Buehler <theo@theobuehler.org>
Cc:
Thomas Adam <thomas@xteddy.org>, Omar Polo <op@omarpolo.com>, gameoftrees@openbsd.org
Date:
Sat, 18 Dec 2021 18:38:54 +0100

Download raw body.

Thread
  • Stefan Sperling:

    mark got_privsep_exec_child as __dead

  • On Sat, Dec 18, 2021 at 12:44:56AM +0100, Theo Buehler wrote:
    > > 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()?
    > > 
    > 
    > It's a hint for the compiler. I think it allows some optimizations like
    > eliminating dead code.  It will also prevent some warnings. As a silly
    > example, compiling the program below will generate a warning:
    
    Thanks, the concept starts making sense to me.
    
    Too bad the existing __dead marker on exit(2) is insufficient.
    I guess compiler developers will have their reasons for this.
    
    
    
  • Stefan Sperling:

    mark got_privsep_exec_child as __dead