I have Encountered a strange "Warning 639: Strong type mismatch for type 'myip' in binary operation"
//file ip4.h
#include <IPAddress.h> // which have ::ip::IPAddress
typedef ::ip::IPAddress myip;
myip myiptest; // lint Warning 639
::ip::IPAddress ip2; // No lint warnings
The IPAddress.h file contains ::ip::IPAddress as follows
namespace ip
{
struct IPAddress
{
IPAddress();
...
};
}
i think there is no mismatching here! the PC-lint manual description for this error:
Check for strong typing when a value is Joined (i.e., combined) with another type across a binary operator.
So what's wrong?
update: after trials it appears that this warning raised only if the struct have a constructor , I think this explains things somehow when i declare an object it returns type ::ip::IPAddress
not myip
here is the mismatch. am i right?