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

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: Are we missing (void) when return value of fsm_set_and_search is ignored?
Дата
Msg-id CAOBaU_aw468VyL3zou5xBdL0JnwCRSmmVAtWs69W1MdC-XURCQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Are we missing (void) when return value of fsm_set_and_search is ignored?  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
On Sat, Jun 5, 2021 at 4:08 AM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
>
> On 04.06.21 06:28, Julien Rouhaud wrote:
> > 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.
>
> I'm not clear how you'd make a guideline out of this, other than, "it's
> also done elsewhere".

When it can be confusing, like here?

> In this case I'd actually split the function in two, one that returns
> void and one that always returns a value to be consumed.  This
> overloading is a bit confusing.

That would work too, but it may be overkill as it's not a public API.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: DELETE CASCADE
Следующее
От: Abbas Butt
Дата:
Сообщение: Logical replication keepalive flood