Re: [HACKERS] Small patch: fix warnings during compilation on FreeBSD

2016-03-15 Thread Aleksander Alekseev
> Please verify that the committed version solves your problem on > FreeBSD. I confirm this patch solves a problem. > I've checked this on my OS X box, which turns out to have the > interesting property that xlocale.h declares wcstombs_l(), but only > if you previously included stdlib.h ... wtf?

Re: [HACKERS] Small patch: fix warnings during compilation on FreeBSD

2016-03-15 Thread Tom Lane
Aleksander Alekseev writes: > OK, I'm not an expert in Autotools but this patch (see attachment) seems > to solve a problem. I fooled around with this some. I felt originally that it should use AC_CHECK_DECL, but that turns out not to work because AC_CHECK_DECL has caching behavior built-in and

Re: [HACKERS] Small patch: fix warnings during compilation on FreeBSD

2016-03-15 Thread Alvaro Herrera
Aleksander Alekseev wrote: > Please note that these changes: > > ``` > -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) > +#define LARGE_OFF_T off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << > 31) << 31)) > ``` > > ... were generated but `autoreconf -iv`. I was not sure what to d

Re: [HACKERS] Small patch: fix warnings during compilation on FreeBSD

2016-03-15 Thread Aleksander Alekseev
> Yeah. In practice, there are exactly two cases we care about: either > both of these functions will be declared in like POSIX > says, or both of them will be in . There's no need to > work harder than we have to do to figure that out. > > I'm totally unimpressed with the proposal of depending

Re: [HACKERS] Small patch: fix warnings during compilation on FreeBSD

2016-03-11 Thread Tom Lane
Robert Haas writes: > On Fri, Mar 11, 2016 at 9:13 AM, Aleksander Alekseev > wrote: >> 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 xlo

Re: [HACKERS] Small patch: fix warnings during compilation on FreeBSD

2016-03-11 Thread Robert Haas
On Fri, Mar 11, 2016 at 9:13 AM, Aleksander Alekseev wrote: > Hello, Tom > >> I think what we need is configure logic to find out where wcstombs_l() >> is declared, and then #include only if it's necessary to >> get that definition. I haven't experimented but probably you could >> make such a ch

Re: [HACKERS] Small patch: fix warnings during compilation on FreeBSD

2016-03-11 Thread Aleksander Alekseev
Hello, Tom > I think what we need is configure logic to find out where wcstombs_l() > is declared, and then #include 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 ha

Re: [HACKERS] Small patch: fix warnings during compilation on FreeBSD

2016-03-10 Thread Tom Lane
Aleksander Alekseev writes: > I noticed that master branch of PostgreSQL currently compiles with > warnings on FreeBSD 10.2 RELEASE: > pg_locale.c:1290:12: warning: implicit declaration of function > 'wcstombs_l' is invalid in C99 [-Wimplicit-function-declaration] > The problem is that both proce