Re: bug in signature of getnameinfo()

Alejandro Colomar
2026-04-09T19:49:07Z

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

Hi Thorsten,

On 2026-04-09T16:42:27+0200, GIquadrat wrote:
> Hi,
>
> https://www.man7.org/linux/man-pages/man3/getnameinfo.3.html
>
> shows a strange signature of getnameinfo:
>
> int getnameinfo(socklen_t hostlen, socklen_t servlen;
> const struct sockaddr *restrict addr, socklen_t addrlen,
> char host[_Nullable restrict hostlen],
> socklen_t hostlen,
> char serv[_Nullable restrict servlen],
> socklen_t servlen,
> int flags);

That's fine. You could try compiling it and you'll see it works as it
should. Just ignore everything before the ';' within the parameter
list (those are forward declarations of parameters).

That's documented in
<https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html>.

Have a lovely night!
Alex

>
> Best regards
> Torsten

--
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]