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

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Are we missing (void) when return value of fsm_set_and_search is ignored?
Дата
Msg-id 50b0355c-2afd-5c0a-5c93-7a2fce268a11@enterprisedb.com
обсуждение исходный текст
Ответ на Are we missing (void) when return value of fsm_set_and_search is ignored?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Are we missing (void) when return value of fsm_set_and_search is ignored?  (Julien Rouhaud <rjuju123@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Are we missing (void) when return value of fsm_set_and_search is ignored?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: improve installation short version