Re: BUG #19062: PostgreSQL 12.22 does not compile because of conflicting types for CollationCreate - Mailing list pgsql-bugs

From Thomas Munro
Subject Re: BUG #19062: PostgreSQL 12.22 does not compile because of conflicting types for CollationCreate
Date
Msg-id CA+hUKGJFXobNm4h6nBLuktyMvMEbwUeqicFaLdZZt6h3BH204w@mail.gmail.com
Whole thread Raw
In response to Re: BUG #19062: PostgreSQL 12.22 does not compile because of conflicting types for CollationCreate  (Peter Dyballa <Peter_Dyballa@Web.DE>)
Responses Re: BUG #19062: PostgreSQL 12.22 does not compile because of conflicting types for CollationCreate
List pgsql-bugs
On Wed, Oct 1, 2025 at 11:46 PM Peter Dyballa <Peter_Dyballa@web.de> wrote:
>         #define bool _Bool
>         #define true 1
>         #define false 0
>         # 49 "/opt/local/lib/gcc14/gcc/powerpc-apple-darwin9/14.2.0/include/stdbool.h" 3 4
>         #define __bool_true_false_are_defined 1
>         # 53 "/opt/local/include/libxml2/unicode/umachine.h" 2

OK, so now we see who is including <stdbool.h>.  If XML support isn't
important to you, perhaps another option would be to remove
--enable-libxml from your configure invocation?  Hmm, that appears to
be a vendored copy of ICU that you get if libxml2 was built with
--with-icu, rather than something coming from libxml's "own" headers.
I guess that means you'll have the same problem again if you also have
--with-icu in your PostgreSQL configure invocation, so you'd need to
take that out too.

> My understanding of C is too limited to see an error and find a solution. So let's leave it!

FTR what I was suggesting is something like CPPFLAGS="-D_STDBOOL_H"
(or append that to anything else you are already putting in CPPFLAGS
on the configure invocation), which should prevent <stdbool.h> from
having any effect, meaning it can't hide c.h's definition.  I don't
know what concrete ABI dangers lurk in this area, but it doesn't look
like ICU uses bool in public interfaces, preferring its own UBool, a
typedef for int8_t.  Hmm, so it's not immediately clear why it
includes it... but I'm too lazy to check.



pgsql-bugs by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: IN List operator , where list of values are over a number of lines
Next
From: Tom Lane
Date:
Subject: Re: BUG #19062: PostgreSQL 12.22 does not compile because of conflicting types for CollationCreate