Re: GinPageIs* don't actually return a boolean

Поиск
Список
Период
Сортировка
От Yury Zhuravlev
Тема Re: GinPageIs* don't actually return a boolean
Дата
Msg-id ab8d039c-09a5-40d9-b68e-aba7103f67c4@postgrespro.ru
обсуждение исходный текст
Ответ на Re: GinPageIs* don't actually return a boolean  (Andres Freund <andres@anarazel.de>)
Ответы Re: GinPageIs* don't actually return a boolean  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund wrote:
> Unless I am missing something major, that doesn't seem to
> achieve all that much. A cast to a char based bool wouldn't
> normalize this to 0 or 1. So you're still not guaranteed to be
> able to do somebool == anotherbool when either are set based on
> such a macro.
>

In C99 cast to bool return 0 or 1 only. In older compilers nothing changes
(Now the code is designed to "char == char").
I think this is a good option. But of course to write bool and use char
strange.

--
Yury Zhuravlev
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: GinPageIs* don't actually return a boolean
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Code of Conduct plan