Re: -O switch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: -O switch
Date
Msg-id 1983525.1604937507@sss.pgh.pa.us
Whole thread Raw
In response to Re: -O switch  (Magnus Hagander <magnus@hagander.net>)
Responses Re: -O switch
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> On Wed, Nov 4, 2020 at 2:10 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> ... looking at this again, BackendRun certainly looks ridiculously
>> over-engineered for what it still does.

> Yeah, looking at it again, I agree. PFA an updated patch, which I'll
> go ahead and push shortly.

LGTM.

> I do noticed when looking through this -- the comment before the function says:

>  * returns:
>  * Shouldn't return at all.
>  * If PostgresMain() fails, return status.

> I'm pretty sure that's incorrect in the current branches as well,
> since it's a void function it will never return anything. Pretty sure
> it should just have the first point and not the second one there, or
> is this trying to convey some meaning I'm just not getting?

Looking at old versions, BackendRun and PostgresMain used to be
declared to return int.  Whoever changed that to void evidently
missed updating this comment.

I'd reduce the whole thing to "Doesn't return."  If you were feeling
really ambitious you could start plastering pg_attribute_noreturn() on
these functions ... but since that would be placed on the declarations,
a comment here would still be in order probably.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Re: abstract Unix-domain sockets
Next
From: Alvaro Herrera
Date:
Subject: Re: PATCH: Report libpq version and configuration