Re: -O switch - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: -O switch
Date
Msg-id CABUevEyfFWOsVGpPoNbHjJk6_3B-8b8R0eqVKfjOzbD5do4ChA@mail.gmail.com
Whole thread Raw
In response to Re: -O switch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Nov 9, 2020 at 4:58 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> 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.

Pushed.


> > 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.

They're already marked pg_attribute_noreturn() in the declarations.
It's just the comment that was a bit out of date.

I'll go fix that one.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Allow some recovery parameters to be changed with reload
Next
From: Bharath Rupireddy
Date:
Subject: Re: Use standard SIGHUP and SIGTERM handlers in autoprewarm module