Re: Small patch: fix warnings during compilation on FreeBSD

From: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Small patch: fix warnings during compilation on FreeBSD
Date: 2016-03-11 14:13:17
Message-ID: 20160311171317.58ad623d@fujitsu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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
and logic like:

```
#if PROC1_DEFINED_IN_XLOCALE || PROC2_DEFINED_IN_XLOCALE ...
#include <xlocale.h>
#endif
```

Perhaps we could just use __FreeBSD__ macro instead (see attachments)?
Or maybe create our own macro ALWAYS_INCLUDE_XLOCALE in configure
script which currently will depend only on used OS? Naturally this
definition could be changed in the future.

Best regards,
Aleksander

Attachment Content-Type Size
freebsd-locale-fix-a.diff text/x-patch 359 bytes
freebsd-locale-fix-b.diff text/x-patch 358 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2016-03-11 14:16:19 Re: auto_explain sample rate
Previous Message Magnus Hagander 2016-03-11 14:11:11 Re: auto_explain sample rate