[HACKERS] !USE_WIDE_UPPER_LOWER compile errors in v10+

Поиск
Список
Период
Сортировка
От Noah Misch
Тема [HACKERS] !USE_WIDE_UPPER_LOWER compile errors in v10+
Дата
Msg-id 20170921052928.GA188913@rfd.leadboat.com
обсуждение исходный текст
Ответ на [HACKERS] ICU locales and text/char(n) SortSupport on Windows  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: [HACKERS] !USE_WIDE_UPPER_LOWER compile errors in v10+  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] !USE_WIDE_UPPER_LOWER compile errors in v10+  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
On Sat, Sep 16, 2017 at 03:33:53PM -0700, Peter Geoghegan wrote:
> On a related note, am I the only one that finds it questionable that
> str_tolower() has an "#ifdef USE_WIDE_UPPER_LOWER" block that itself
> contains an "#ifdef USE_ICU" block? It seems like those two things
> might get conflated on some platforms. We don't want lower() to ever
> not use the ICU infrastructure when an ICU collation is used, and yet
> it's not obvious that that's impossible. I understand that the code in
> regc_pg_locale.c kind of insists on using USE_WIDE_UPPER_LOWER
> facilities, and that that was always accepted as legacy that ICU had
> to live with. Maybe a static assertion is all that we need here (ICU
> builds must also be USE_WIDE_UPPER_LOWER builds).

I checked !USE_WIDE_UPPER_LOWER by configuring v10 as follows:
 ./configure -C --prefix=$HOME/sw/nopath/pg10 --enable-debug \     --enable-cassert --enable-depend --enable-tap-tests
--with-libxml\     --with-gssapi --with-openssl ac_cv_func_towlower=no
 

The result fails to compile:

$ make
formatting.c: In function ‘str_tolower’:
formatting.c:1623:10: error: ‘mylocale’ undeclared (first use in this function)     if (mylocale)         ^
... snipped other errors ...

A --with-icu build fails similarly.  PG9.6 builds and passes "make check".

Perhaps it is time to require HAVE_WCSTOMBS and HAVE_TOWLOWER, removing
USE_WIDE_UPPER_LOWER?  Every buildfarm fossil has both.  Solaris 2.5.1 (out of
support for 12 years) might be the most interesting OS affected:

https://www.gnu.org/software/gnulib/manual/html_node/towlower.html
https://www.gnu.org/software/gnulib/manual/html_node/wcstombs.html


The above-described topic is currently a PostgreSQL 10 open item.  Peter
(Eisentraut), since you committed the patch believed to have created it, you
own this open item.  If some other commit is more relevant or if this does not
belong as a v10 open item, please let us know.  Otherwise, please observe the
policy on open item ownership[1] and send a status update within three
calendar days of this message.  Include a date for your subsequent status
update.  Thanks.

[1] https://www.postgresql.org/message-id/20170404140717.GA2675809%40tornado.leadboat.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.
Следующее
От: Noah Misch
Дата:
Сообщение: Re: [HACKERS] ICU locales and text/char(n) SortSupport on Windows