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

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(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-03 12:57:42
Message-ID: 50b0355c-2afd-5c0a-5c93-7a2fce268a11@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03.06.21 12:54, Bharath Rupireddy wrote:
> It looks like for some of the fsm_set_and_search calls whose return
> value is ignored (in fsm_search and RecordPageWithFreeSpace), there's
> no (void). Is it intentional? In the code base, we generally have
> (void) when non-void return value of a function is ignored.

I don't think that is correct. I don't see anyone writing

(void) printf(...);

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-06-03 13:01:05 Re: improve installation short version
Previous Message Bharath Rupireddy 2021-06-03 12:54:08 Re: Are we missing (void) when return value of fsm_set_and_search is ignored?