Thanks for the additional information. That kind of compiler change is hostile
to autoconf, whose developers (looking over conversations on their mailing list
over many years) do not feel that they can avoid warnings across all compilers
in its code snippets. There does appear to be some effort in the autoconf core
macros to avoid implicit function declaration warnings, but of course custom
tests can fail, as in this case.
I have identified three tests that produce the wrong answer with
-Werror=implicit-function-declarations: this one, the test for Tcl, and the
test for in6addr_any. I will work on a patch for all three.