Re: GinPageIs* don't actually return a boolean

From: Yury Zhuravlev <u(dot)zhuravlev(at)postgrespro(dot)ru>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Teodor Sigaev <teodor(at)sigaev(dot)ru>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GinPageIs* don't actually return a boolean
Date: 2016-02-12 16:40:29
Message-ID: ab8d039c-09a5-40d9-b68e-aba7103f67c4@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-02-12 16:43:49 Re: Code of Conduct plan
Previous Message Andres Freund 2016-02-12 16:39:05 Re: GinPageIs* don't actually return a boolean