Thread (1 message) 1 message, 1 author, 2026-04-09

Re: bug in signature of getnameinfo()

From: Alejandro Colomar <alx@kernel.org>
Date: 2026-04-09 19:49:07

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>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help