I have code that PC-Lint gives me Error 503: Boolean argument for relational . This is a call to a template function, which is defined as follows:
template <typename ITypeToUse>
void ShowWindowEx(
HWND hWnd,
int nCmdShow,
ITypeToUse *pControl);
The call itself is as follows:
ShowWindowEx<IActualType>(this->GetWndHandle(), SW_SHOW, m_spControl);
Initially, the part is ShowWindowEx<IActualType>(...)interpreted as Identifier1 < Identifier2 > Expression... PC-Lint does not seem to know that ShowWindowExit is a template function that requires a type in square brackets and tries to best interpret it as a Boolean expression.
I know that I can just tell lint to ignore this error for this line (although in fact it is about 30 lines), but I would like this not to happen again. Also, as far as I know, PC-Lint should be able to handle template function calls, any idea why this is not the case here?
The declaration is inside the class in the header, and the call is in another member function of this class, which is declared immediately before ShowWindowEx. The implementation of both member functions occurs in the .cpp file in the same order, so the ShowWindowEx call occurs before it is implemented. Is it possible that PC-Lint simply ignored the header?
EDIT: Now I changed the function prototype to:
template <typename IPointerToUse>
void ShowWindowEx(
HWND hWnd,
int nCmdShow,
IPointerToUse pControl);
, , . DeadMG . - , , , .