Re: Are we missing (void) when return value of fsm_set_and_search is ignored?

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Are we missing (void) when return value of fsm_set_and_search is ignored?
Date: 2021-06-04 11:33:21
Message-ID: CALj2ACX0XBi=WGG+MB1t-SmesC1vEk9L-nF7qAurem48N=82Xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 4, 2021 at 9:58 AM Julien Rouhaud <rjuju123(at)gmail(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2021-06-04 11:44:30 Re: Skip partition tuple routing with constant partition key
Previous Message Bharath Rupireddy 2021-06-04 11:33:03 Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options