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

From Dmitry Ivanov
Subject Re: GinPageIs* don't actually return a boolean
Date
Msg-id 1745981.L5LNPAf4LD@abook
Whole thread Raw
In response to Re: GinPageIs* don't actually return a boolean  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
> OK, that seems reasonable from here.  What I'm still fuzzy about is
> why including stdbool.h causes a failure. Is it because it defines a
> type called "bool" that clashes with ours?  That seems like the
> obvious explanation, but then how does that not cause the compiler to
> just straight-up error out?

stdbool.h defines the '_Bool' type. The standard says:

C99 and C11 §6.3.1.2/1 “When any scalar value is converted to _Bool, the
result is 0 if the value compares equal to 0; otherwise, the result is 1.”

It seems that MSVC's bool (_Bool) assignment complies to the standard.

--
Dmitry Ivanov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby
Next
From: Andres Freund
Date:
Subject: Re: GinPageIs* don't actually return a boolean