Re: Small patch: fix warnings during compilation on FreeBSD

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Small patch: fix warnings during compilation on FreeBSD
Date: 2016-03-11 15:30:07
Message-ID: CA+TgmoZP90nJ0-kO9g114M+F7QgrWGx3GxWo+X+2zqOQz-244w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 11, 2016 at 9:13 AM, Aleksander Alekseev
<a(dot)alekseev(at)postgrespro(dot)ru> wrote:
> Hello, Tom
>
>> I think what we need is configure logic to find out where wcstombs_l()
>> is declared, and then #include <xlocale.h> only if it's necessary to
>> get that definition. I haven't experimented but probably you could
>> make such a check with nested uses of AC_CHECK_DECL.
>
> Sounds like quite a dirty hack to me. Besides so far we have only two
> procedures from xlocale.h and this requires two checks. If we go this
> way someday there will be 15 checks for every procedure from xlocale.h

Eh, probably not. Most likely, if you check whether one of the
functions you care about is in that file, that's good enough. Either
all of them will be there or none of them. That may sound
unprincipled, but I think in practice it works pretty well, and I
think it's basically the autoconf way. You make the checks just
sophisticated enough to work on all of the platforms that actually
exist, and don't worry about hypothetical platforms where the header
file authors conspire to hose you.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-03-11 15:40:38 Re: Small patch: fix warnings during compilation on FreeBSD
Previous Message Simon Riggs 2016-03-11 15:07:00 PostgreSQL 9.6 Release Management Team (RMT)