Re: Are we missing (void) when return value of fsm_set_and_search is ignored? - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Are we missing (void) when return value of fsm_set_and_search is ignored?
Date
Msg-id CALj2ACX0XBi=WGG+MB1t-SmesC1vEk9L-nF7qAurem48N=82Xw@mail.gmail.com
Whole thread Raw
In response to Re: Are we missing (void) when return value of fsm_set_and_search is ignored?  (Julien Rouhaud <rjuju123@gmail.com>)
List pgsql-hackers
On Fri, Jun 4, 2021 at 9:58 AM Julien Rouhaud <rjuju123@gmail.com> wrote:
> > so this is not a generally applicable strategy.
> >
> > We have pg_nodiscard for functions where you explicitly want callers to
> > check the return value.  In all other cases, callers are free to ignore
> > return values.
>
> Yes, but we have a lot a examples of functions without pg_nodiscard and callers
> still explicitly ignoring the results, like fsm_vacuum_page() in the same file.
> It would be more consistent and make the code slightly more self explanatory.

Yeah, just for consistency reasons (void) casting can be added to fsm_set_and_search when it's return value is ignored.

With Regards,
Bharath Rupireddy.

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options
Next
From: Amit Langote
Date:
Subject: Re: Skip partition tuple routing with constant partition key