Re: [HACKERS] psql compile errors - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] psql compile errors
Date
Msg-id 1391.945539202@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] psql compile errors  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: [HACKERS] psql compile errors
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> If these are indeed all the errors, then I would like to know what version
> of readline it is you're using. There is no constant or macro defined for
> that AFAICS, so you might have to infer that from a package name or other
> sources. Mine goes by the name of 2.2.1. Note that this is not the same as
> the version number on the libreadline shared library, where mine says 3.0.

Hmm.  I recall that I used to have an ancient copy of libreadline
(2.something) but awhile ago (between 6.4 and 6.5, I think) someone
changed psql in a way that rendered it incompatible with that version.
Rather than arguing, I just upgraded to the current libreadline 4.0.
Have you restored compatibility with the old readline version?  That'd
be nice, I guess, but it's probably more important to be sure psql still
works with the current readline...

>> tab-complete.c:262: warning: implicit declaration of function `snprintf'

> That looks a little odd, since that prototype is declared in c.h, which is
> included in tab-complete.c, conditional on config.h macros, which is also
> included in tab-complete.c (before c.h), so maybe a configure problem?

I've run into this myself (for vsnprintf not snprintf but I bet the
problem is the same).  c.h provides a declaration of these routines if
HAVE_SNPRINTF etc are not set.  But the configure script sets
HAVE_SNPRINTF on the basis of a link check that tests whether such
functions actually exist in libc.  There are some braindead platforms
that provide library functions but don't offer a declaration for them
anywhere.  I see this with vsnprintf on HPUX 10.20, and I'll bet
snprintf is that way on other platforms.  What's needed is for configure
to test separately for the existence of the function and whether the
system header files provide a prototype :-(.

>> tab-complete.c: In function `quote_file_name':
>> tab-complete.c:790: `SINGLE_MATCH' undeclared (first use in this function)
>> tab-complete.c:786: warning: `length' might be used uninitialized in this function

> HUH???

Yup, Jan's running a different libreadline than you are.

AFAICS there's no compile-time symbol identifying the libreadline
version, which is a dumb choice for a library that keeps adding new API.
Perhaps more configure checks are needed to distinguish which
libreadline we have, or at least to act like readline is not present
at all if it's not at least version X.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Frans Van Elsacker
Date:
Subject:
Next
From: "Oliver Elphick"
Date:
Subject: Re: [HACKERS] SPI header dependencies