On GNU/Linux with GCC 14.2, I noticed the following:
$ gnulib-tool --create-testdir --dir testdir1 getaddrinfo
$ cd testdir1
$ ./configure
[...]
checking for getaddrinfo... yes
checking whether getaddrinfo supports AI_NUMERICSERV... no
[...]
In config.log there is the following:
configure:20031: checking whether getaddrinfo supports AI_NUMERICSERV
configure:20078: gcc -o conftest -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:131:66: error: passing argument 4 of 'getaddrinfo' from
incompatible pointer type [-Wincompatible-pointer-types]
131 | return getaddrinfo ("www.gnu.org", "http", &hints,
&ai) != EAI_NONAME;
| ^~~
| |
|
struct addrinfo *
In file included from conftest.c:115:
/usr/include/netdb.h:663:54: note: expected 'struct addrinfo ** restrict'
but argument is of type 'struct addrinfo *'
663 | struct addrinfo **__restrict __pai);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
If I remember correctly, this code would warn on previous versions of
GCC. But on GCC 14 it is an error by default.
The error in that case is good anyways since that program would probably
have getaddrinfo succeed and then accessing AI would give you trash or
segfault.
Collin