cppcheck

"Socket operation on non-socket" error due to strange syntax

I ran across the error Socket operation on non-socket in some of my networking code when calling connect and spent a lot of time trying to figure out what was causing it. I finally figured out that the following line of code was causing the problem: if ((sockfd = socket( ai->ai_family, ai->ai_socktype, ai->ai_protocol) < 0)) { See th...

A warning with cppcheck, "hides typedef with same name"

This is a cppcheck warning message. Variable 'BUFFER_INFO' hides typedef with same name The BUFFER_INFO is defined as following. typedef struct tagBufferInfo { CRITICAL_SECTION cs; Buffer* pBuffer1; Buffer* pBuffer2; Buffer* pLoggingBuffer; Buffer* pSendingBuffer; }BUFFER_INFO, *PBUFFER_INFO; And I wrote, PBUFF...