This website uses cookies and other technology to provide you a more personalized
experience. By
continuing the view of our web-pages you accept the terms of using these files. If you
don't
want your personal data to be processed, please, leave this site.
Learn More →
V580. Suspicious explicit type casting. Consider inspecting the expression.
The analyzer detected an odd explicit type conversion. It may be either an error or a potential error.
Consider this sample:
DWORD errCode = 0;
void* dwErrParams[MAX_MESSAGE_PARAMS];
dwErrParams[0] = *((void**)&errCode);
The code contains a 64-bit error. The 'DWORD' type is cast to 'void *' type. This code works incorrectly in 64-bit systems where the pointer's size does not coincide with the size of the DWORD type. This is the correct code:
DWORD_PTR errCode = 0;
void* dwErrParams[MAX_MESSAGE_PARAMS];
dwErrParams[0] = (void *)errCode;
This diagnostic is classified as:
|