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

From Yury Zhuravlev
Subject Re: GinPageIs* don't actually return a boolean
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: GinPageIs* don't actually return a boolean  (Andres Freund <[email protected]>)
Responses Re: GinPageIs* don't actually return a boolean
List 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 by date:

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