Re: [HACKERS] taking stdbool.h into use

2017-11-08 Thread Michael Paquier
On Thu, Nov 9, 2017 at 1:46 AM, Peter Eisentraut wrote: > On 10/29/17 08:50, Michael Paquier wrote: >> I spotted a couple of other things while looking at your patches and >> the code tree. >> >> - return (ginCompareItemPointers(&btree->itemptr, iptr) > 0) ? TRUE : >> FALSE; >> + return (ginC

Re: [HACKERS] taking stdbool.h into use

2017-11-08 Thread Peter Eisentraut
On 10/29/17 08:50, Michael Paquier wrote: > I had a look at this patch series. Patches 1, 2 (macos headers indeed > show that NSUNLINKMODULE_OPTION_NONE is set to 0x0), 3 to 7 look fine > to me. Committed 4 and 5 together. > I spotted a couple of other things while looking at your patches and > t

Re: [HACKERS] taking stdbool.h into use

2017-11-04 Thread Peter Eisentraut
On 10/29/17 08:50, Michael Paquier wrote: > On Thu, Oct 26, 2017 at 9:25 AM, Peter Eisentraut > wrote: >> Here is an updated patch set. This is just a rebase of the previous >> set, no substantial changes. Based on the discussion so far, I'm >> proposing that 0001 through 0007 could be ready to

Re: [HACKERS] taking stdbool.h into use

2017-10-29 Thread Michael Paquier
On Thu, Oct 26, 2017 at 9:25 AM, Peter Eisentraut wrote: > Here is an updated patch set. This is just a rebase of the previous > set, no substantial changes. Based on the discussion so far, I'm > proposing that 0001 through 0007 could be ready to commit after review, > whereas the remaining two

Re: [HACKERS] taking stdbool.h into use

2017-10-28 Thread Michael Paquier
On Thu, Oct 26, 2017 at 5:41 PM, Tom Lane wrote: > While warnings for this would be lovely, I don't see how we can expect to > get any. This is perfectly correct C code no matter whether isprimary > is C99 bool or is typedef'd to char ... you just end up with different > values of isprimary, shou

Re: [HACKERS] taking stdbool.h into use

2017-10-26 Thread Tom Lane
Alvaro Herrera writes: > Michael Paquier wrote: >> It seems to me that this proves the point of the proposed patch. You >> had better use a zero-equality comparison for such bitwise operation, >> and so you ought to do that: >> boolisprimary = (flags & INDEX_CREATE_IS_PRIMARY) != 0; > Rig

Re: [HACKERS] taking stdbool.h into use

2017-10-26 Thread Michael Paquier
On Thu, Oct 26, 2017 at 3:48 PM, Alvaro Herrera wrote: > Right, exactly. But my point is that with the whole patch series > applied I didn't get any warnings. Sorry, I misread your message. You use Linux I suppose, what's your compiler? -- Michael -- Sent via pgsql-hackers mailing list (pgsq

Re: [HACKERS] taking stdbool.h into use

2017-10-26 Thread Alvaro Herrera
Michael Paquier wrote: > On Thu, Oct 26, 2017 at 10:51 AM, Alvaro Herrera > wrote: > > I gave this a quick run, to see if my compiler would complain for things > > like this: > > > >boolisprimary = flags & INDEX_CREATE_IS_PRIMARY; > > > > (taken from the first patch at > > https://post

Re: [HACKERS] taking stdbool.h into use

2017-10-26 Thread Michael Paquier
On Thu, Oct 26, 2017 at 10:51 AM, Alvaro Herrera wrote: > I gave this a quick run, to see if my compiler would complain for things > like this: > >boolisprimary = flags & INDEX_CREATE_IS_PRIMARY; > > (taken from the first patch at > https://postgr.es/m/20171023161503.ohkybquxrlech7d7@a

Re: [HACKERS] taking stdbool.h into use

2017-10-26 Thread Alvaro Herrera
Peter Eisentraut wrote: > Here is an updated patch set. This is just a rebase of the previous > set, no substantial changes. Based on the discussion so far, I'm > proposing that 0001 through 0007 could be ready to commit after review, > whereas the remaining two need more work at some later time.

Re: [HACKERS] taking stdbool.h into use

2017-09-16 Thread Peter Eisentraut
On 9/14/17 22:35, Tom Lane wrote: > Peter Eisentraut writes: >> 0005-Make-casting-between-bool-and-GinTernaryValue-more-r.patch >> 0008-Use-stdbool.h-if-available.patch > >> These need some more work based on Tom's feedback. > >> Attached is a new patch set. Based on the discussion so far, 0001

Re: [HACKERS] taking stdbool.h into use

2017-09-14 Thread Tom Lane
Peter Eisentraut writes: > 0005-Make-casting-between-bool-and-GinTernaryValue-more-r.patch > 0008-Use-stdbool.h-if-available.patch > These need some more work based on Tom's feedback. > Attached is a new patch set. Based on the discussion so far, 0001 > through 0007 might be ready; the other tw

Re: [HACKERS] taking stdbool.h into use

2017-08-24 Thread Tom Lane
Peter Eisentraut writes: > Some not so long time ago, it was discussed to look into taking > stdbool.h into use. The reason was that third-party libraries (perl?, > ldap?, postgis?) are increasingly doing so, and having incompatible > definitions of bool could/does create a mess. > Here is a pat

Re: [HACKERS] taking stdbool.h into use

2017-08-16 Thread Michael Paquier
On Wed, Aug 16, 2017 at 11:20 PM, Tom Lane wrote: > Don't know how far back you need to go to find Windows machines > with 4-byte bool, but we have some pretty long-in-the-tooth > buildfarm critters in that lineage, too. >From VS 2003 and upwards the size has always been 1: https://msdn.microsoft

Re: [HACKERS] taking stdbool.h into use

2017-08-16 Thread Tom Lane
I wrote: > gaur/pademelon isn't booted up right now, but it might provide > an example of a system that lacks altogether. > (If it doesn't, I'd be willing to concede that we need not > consider that scenario anymore.) For the record --- pademelon (vendor cc on that box) doesn't have at all. gau

Re: [HACKERS] taking stdbool.h into use

2017-08-16 Thread Tom Lane
Thomas Munro writes: > However my system has sizeof(bool) == 1 and so do all the systems I > have access to (x86 + POWER). Where can we find a computer with > sizeof(bool) == 4? According to the intertubes OSX on POWER and > Windows 32 bit systems had that in ancient prehistory but they don't >

Re: [HACKERS] taking stdbool.h into use

2017-08-15 Thread Thomas Munro
On Wed, Aug 16, 2017 at 4:36 PM, Peter Eisentraut wrote: > Some not so long time ago, it was discussed to look into taking > stdbool.h into use. The reason was that third-party libraries (perl?, > ldap?, postgis?) are increasingly doing so, and having incompatible > definitions of bool could/does