Re: cpluspluscheck vs ICU again
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: John Naylor <johncnaylorls@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Peter Eisentraut <peter@eisentraut.org>
Date: 2025-07-04T15:11:49Z
Lists: 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
Commits
-
Update ICU C++ API symbols
- 9560c1ec1c93 13.22 landed
- a4f891b96235 14.19 landed
- baacfb9e609c 15.14 landed
- aae9aad19d82 16.10 landed
- 21ae8fc5fd86 17.6 landed
- dd29262077e8 18.0 landed
- 90bfae9f93e7 19 (unreleased) landed
-
Hide ICU C++ APIs from pg_locale.h
- ed26c4e25a44 19 (unreleased) landed
-
Remove implicit cast from 'void *'
- 3e73d8735371 18.0 landed
- 9adb58a3ccb5 19 (unreleased) landed
-
Inline CRC computation for small fixed-length input on x86
- e2809e3a1015 18.0 cited