!USE_WIDE_UPPER_LOWER compile errors in v10+

From: Noah Misch <noah(at)leadboat(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: !USE_WIDE_UPPER_LOWER compile errors in v10+
Date: 2017-09-21 05:29:28
Message-ID: 20170921052928.GA188913@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2017-09-21 06:05:24 Re: ICU locales and text/char(n) SortSupport on Windows
Previous Message Michael Paquier 2017-09-21 05:25:06 Re: Assertion failure when the non-exclusive pg_stop_backup aborted.