Re: GinPageIs* don't actually return a boolean - Mailing list pgsql-hackers

From Andres Freund
Subject Re: GinPageIs* don't actually return a boolean
Date
Msg-id 3366513D-E909-4F83-8043-B5B247FAFF0F@anarazel.de
Whole thread Raw
In response to Re: GinPageIs* don't actually return a boolean  (Yury Zhuravlev <u.zhuravlev@postgrespro.ru>)
Responses Re: GinPageIs* don't actually return a boolean
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Code of Conduct plan
Next
From: Tom Lane
Date:
Subject: Re: GinPageIs* don't actually return a boolean