I would try fix them (not all of them, at least the ones I ran into).
Example of code which gives this warning : class SocketAddress
- Code: Select all
const struct sockaddr* addr() const;
inline bool SocketAddress::operator == (const SocketAddress& addr) const
{
return host() == addr.host() && port() == addr.port();
}
inline bool SocketAddress::operator != (const SocketAddress& addr) const
{
return host() != addr.host() || port() != addr.port();
}
The compiler warns that the 2 'addr' arguments are shadowing the "addr" method.
A suggestion on how to solve it, give the incoming parameter a different name : addrIn
This warning option is a an important one, because often it shows unintended hiding, revealing bugs.
Is it acceptable that the poco code would use such 'In' postfix in the places that give rise to this warning ?
If so, I would fix some of them and provide a pull request with it.
- Code: Select all
inline bool SocketAddress::operator != (const SocketAddress& addrIn) const
{
return host() != addrIn.host() || port() != addrIn.port();
}





