Thread: BUG #16791: Compile error with new ICU 68.2 for 10.15

BUG #16791: Compile error with new ICU 68.2 for 10.15

From
PG Bug reporting form
Date:
The following bug has been logged on the website:

Bug reference:      16791
Logged by:          Yury Zhuravlev
Email address:      stalkerg@gmail.com
PostgreSQL version: 10.15
Operating system:   Gentoo Linux
Description:

Hello,

Basically, it's a same issue as here
https://www.postgresql.org/message-id/7a6f3336165bfe3ca66abcda7966f9d0@stz-bg.com
but latest small fix not really help for 10.15. In the same time 13.1 I can
build without issue. 
Log:
```
pg_collation.c:47:1: error: conflicting types for ‘CollationCreate’
   47 | CollationCreate(const char *collname, Oid collnamespace,
      | ^~~~~~~~~~~~~~~
In file included from pg_collation.c:25:
../../../src/include/catalog/pg_collation_fn.h:17:12: note: previous
declaration of ‘CollationCreate’ was here
   17 | extern Oid CollationCreate(const char *collname, Oid
collnamespace,
      |            ^~~~~~~~~~~~~~~
pg_collation.c: In function ‘CollationCreate’:
pg_collation.c:171:41: warning: passing argument 3 of ‘heap_form_tuple’ from
incompatible pointer type [-Wincompatible-pointer-types]
  171 |  tup = heap_form_tuple(tupDesc, values, nulls);
      |                                         ^~~~~
      |                                         |
      |                                         _Bool *
In file included from pg_collation.c:19:
../../../src/include/access/htup_details.h:802:26: note: expected ‘bool *’
{aka ‘char *’} but argument is of type ‘_Bool *’
  802 |     Datum *values, bool *isnull);
      |                    ~~~~~~^~~~~~
make[3]: *** [<builtin>: pg_collation.o] Error 1
make[3]: Leaving directory
'/var/tmp/portage/dev-db/postgresql-10.15/work/postgresql-10.15/src/backend/catalog'
make[2]: *** [common.mk:41: catalog-recursive] Error 2
```

Thanks.


Re: BUG #16791: Compile error with new ICU 68.2 for 10.15

From
Tom Lane
Date:
PG Bug reporting form <noreply@postgresql.org> writes:
> Log:
> ```
> pg_collation.c:47:1: error: conflicting types for ‘CollationCreate’
>    47 | CollationCreate(const char *collname, Oid collnamespace,
>       | ^~~~~~~~~~~~~~~
> In file included from pg_collation.c:25:
> ../../../src/include/catalog/pg_collation_fn.h:17:12: note: previous
> declaration of ‘CollationCreate’ was here
>    17 | extern Oid CollationCreate(const char *collname, Oid
> collnamespace,
>       |            ^~~~~~~~~~~~~~~

Presumably this is caused by ICU forcibly including <stdbool.h>
and thereby changing what "bool" is.  Since we only started to use
stdbool.h booleans in v11, that's not going to work in v10 or below.

I'm afraid that the short answer is "we're not gonna fix that".
As per the other thread you mentioned, it's possible that we could
make it work by #undef'ing bool in the right places.  But the effort
involved and the likely fragility of the results seem discouraging.

If you want to use a bleeding-edge ICU version, don't use a hoary
Postgres version.

            regards, tom lane