struct hostent (under both windows and unices) that’s used for example with gethostbyname() et al. keeps the dotted addresses using a pointer to signed char.
What’s the benefit of this when it’s known in advance that addresses can and mostly do contain numbers > 127, and that they’re ultimately represented unsigned? Is there any benefit from having signability, any edge case covered? Or is it just a historical baggage?
Probably it is just historical baggage – just like the functions using it.
Nowadays, it is recommended to use
getaddrinfo()andgetnameinfo()in order to be protocol-independent.gethostbyname()is obsolete, just like its counterpartgethostbyaddr().