Re: GinPageIs* don't actually return a boolean

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: GinPageIs* don't actually return a boolean
Дата
Msg-id 3366513D-E909-4F83-8043-B5B247FAFF0F@anarazel.de
обсуждение исходный текст
Ответ на Re: GinPageIs* don't actually return a boolean  (Yury Zhuravlev <u.zhuravlev@postgrespro.ru>)
Ответы Re: GinPageIs* don't actually return a boolean  (Yury Zhuravlev <u.zhuravlev@postgrespro.ru>)
Список pgsql-hackers
On February 12, 2016 5:40:29 PM GMT+01:00, Yury Zhuravlev <u.zhuravlev@postgrespro.ru> wrote:
>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.

Don't you say. That's why I brought all this up.


> 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.

Did you read what I wrote? That's not correct for char booleans, because the can have different bits set.

Andres

--- 
Please excuse brevity and formatting - I am writing this on my mobile phone.



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

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