pgsql: Fix configure's AC_CHECK_DECLS tests to work correctly with clan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix configure's AC_CHECK_DECLS tests to work correctly with clan
Date: 2018-11-19 17:02:10
Message-ID: E1gOmw6-0008TB-1d@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix configure's AC_CHECK_DECLS tests to work correctly with clang.

The test case that Autoconf uses to discover whether a function has
been declared doesn't work reliably with clang, because clang reports
a warning not an error if the name is a known built-in function.
On some platforms, this results in a lot of compile-time warnings about
strlcpy and related functions not having been declared.

There is a fix for this (by Noah Misch) in the upstream Autoconf sources,
but since they've not made a release in years and show no indication of
doing so anytime soon, let's just absorb their fix directly. We can
revert this when and if we update to a newer Autoconf release.

Back-patch to all supported branches.

Discussion: https://postgr.es/m/26819.1542515567@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dcd6200165ca583cc1b0d436774cf4c3cf7e642d

Modified Files
--------------
aclocal.m4 | 1 +
config/check_decls.m4 | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++
configure | 104 ++++++++++++++++++++++++++++++++++++++++++--
configure.in | 9 ++--
4 files changed, 223 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2018-11-19 17:13:23 pgsql: Reduce unnecessary list construction in RelationBuildPartitionDe
Previous Message Alvaro Herrera 2018-11-19 14:17:04 pgsql: Disallow COPY FREEZE on partitioned tables