Hi Davide, > that might be useful for other future CLIENT_DEBUG() users. > Fair enough, Wish there was a printf extension for ipv4 and ipv6 addresses like printk uses... Oh well. > > yes, it seems to look better - I will also fix this. > By the way, looking at the inet_ntop() documentation [1], I think that I can > also avoid things like > >    inet_ntop(AF_INET, &ia, buf, INET_ADDRSTRLEN) ? : "(inv)"; > > because the first argument is hardcoded to AF_INET and also we are sure that > 'buf' is INET_ADDRSTRLEN long. > Under these conditions, the return value of inet_ntop() should always be 'buf'. > Correct? I would assume so. You can tell for sure by looking at glibc implementation for example. Oh, one other thing. Have you checked the scope rules for GCC statement expressions? inet_ntoa uses a static buffer (which glibc further enhances by marking it as thread-specific storage). So the returned pointer is guaranteed to be valid after inet_ntoa returns. The statement expression doesn't seem to do that, so that seems suspicious? Regards, -Denis