Re: cpluspluscheck vs ICU again - Mailing list pgsql-hackers

From Tom Lane
Subject Re: cpluspluscheck vs ICU again
Date
Msg-id 247061.1751641909@sss.pgh.pa.us
Whole thread Raw
In response to implicit casts from void*  (John Naylor <johncnaylorls@gmail.com>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2025-07-02 14:01:13 +0700, John Naylor wrote:
>> I came up with the attached -- Andres, Peter, does this match your recollection?

> I think the proper fix here would be to not expose ucol.h to the world,
> i.e. not include it from something like pg_locale.h.

The stumbling block to that is that pg_locale_struct has a field of
type UCollator.  Of course there are workarounds, but I think all of
them are strictly worse than including <ucol.h> here.

>> +/* restore so that extensions can include the C++ APIs */
>> +#undef U_SHOW_CPLUSPLUS_API

> Does the #undef U_SHOW_CPLUSPLUS_API thing actually work, given that ucol.h
> presumably won't be included again due to #ifdef protection?

Good point.  If a .cpp file wants access to the C++ APIs, it'd have
to include <unicode/ucol.h> before not after including pg_locale.h.
That should work AFAICS, but this #undef doesn't help.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Yugo Nagata
Date:
Subject: Re: Suggestion to add --continue-client-on-abort option to pgbench
Next
From: Yugo Nagata
Date:
Subject: Re: Suggestion to add --continue-client-on-abort option to pgbench