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

From Peter Eisentraut
Subject Re: Are we missing (void) when return value of fsm_set_and_search is ignored?
Date
Msg-id 50b0355c-2afd-5c0a-5c93-7a2fce268a11@enterprisedb.com
Whole thread Raw
In response to Are we missing (void) when return value of fsm_set_and_search is ignored?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Are we missing (void) when return value of fsm_set_and_search is ignored?
List 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.



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Are we missing (void) when return value of fsm_set_and_search is ignored?
Next
From: Peter Eisentraut
Date:
Subject: Re: improve installation short version