Possible explanation for readline configuration problems - Mailing list pgsql-hackers

We've gotten several different reports lately of peculiar compilation
errors and warnings involving readline in 7.1.  They look like configure
is actively doing the wrong thing --- for example, how could we see
reports like this:

tab-complete.c:734: `filename_completion_function' undeclared (first use in this function)
tab-complete.c:734: (Each undeclared identifier is reported only once
tab-complete.c:734: for each function it appears in.)

when the code makes a point of providing a declaration for
filename_completion_function if configure didn't see it in the headers?

After eyeballing the code I think I have a theory.  psql/input.h will
preferentially include <readline/readline.h>, not <readline.h>, if both
HAVE_READLINE_READLINE_H and HAVE_READLINE_H are defined.  But the tests
in configure make the opposite choice!  Maybe the people who are having
trouble have two different versions of readline header files visible at
those two names, leading to configure's results being wrong for the
header file that input.h actually selects?

In normal situations this still wouldn't matter because configure only
defines one of the two symbols HAVE_READLINE_READLINE_H and HAVE_READLINE_H.
BUT: suppose someone runs configure, then installs a newer libreadline
and runs configure again?  I think caching of configure results could
lead to both symbols becoming defined, if both headers are out there.

It's a bit of a reach, but I'm having a hard time seeing how configure
could produce the wrong results otherwise.  Thoughts?

Andrea and Kevin, what do your src/include/config.h files have for
these symbols?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: NetBSD "Bad address" failure (was Re: Third call for platform testing)
Next
From: Mark Butler
Date:
Subject: Postmaster fatal defect - pl/pgsql return type conversion