"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/cfg/windows.cpp" between
cppcheck-1.86.tar.gz and cppcheck-1.87.tar.gz

About: Cppcheck is a static analysis tool for C/C++ code. It checks for memory leaks, mismatching allocation-deallocation, buffer overrun, and many more.

windows.cpp  (cppcheck-1.86):windows.cpp  (cppcheck-1.87)
skipping to change at line 260 skipping to change at line 260
lstrcat(buf, NULL); lstrcat(buf, NULL);
HANDLE hMutex; HANDLE hMutex;
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer
hMutex = OpenMutex(MUTEX_ALL_ACCESS, FALSE, NULL); hMutex = OpenMutex(MUTEX_ALL_ACCESS, FALSE, NULL);
CloseHandle(hMutex); CloseHandle(hMutex);
//Incorrect: 1. parameter, must not be null //Incorrect: 1. parameter, must not be null
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer
FARPROC pAddr = GetProcAddress(NULL, "name"); FARPROC pAddr = GetProcAddress(NULL, "name");
(void)pAddr;
HMODULE * phModule = NULL; HMODULE * phModule = NULL;
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer
GetModuleHandleEx(0, NULL, phModule); GetModuleHandleEx(0, NULL, phModule);
// cppcheck-suppress leakReturnValNotUsed // cppcheck-suppress leakReturnValNotUsed
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer
OpenEvent(EVENT_ALL_ACCESS, FALSE, NULL); OpenEvent(EVENT_ALL_ACCESS, FALSE, NULL);
HANDLE hEvent = NULL; HANDLE hEvent = NULL;
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer
PulseEvent(hEvent); PulseEvent(hEvent);
skipping to change at line 535 skipping to change at line 536
CloseHandle(hMutex); CloseHandle(hMutex);
//Incorrect: 2. parameter to LoadLibraryEx() must be NULL //Incorrect: 2. parameter to LoadLibraryEx() must be NULL
// cppcheck-suppress invalidFunctionArg // cppcheck-suppress invalidFunctionArg
HINSTANCE hInstLib = LoadLibraryEx(L"My.dll", 1, 0); HINSTANCE hInstLib = LoadLibraryEx(L"My.dll", 1, 0);
FreeLibrary(hInstLib); FreeLibrary(hInstLib);
// cppcheck-suppress invalidFunctionArg // cppcheck-suppress invalidFunctionArg
void *pMem = _malloca(-1); void *pMem = _malloca(-1);
_freea(pMem); _freea(pMem);
// cppcheck-suppress unreadVariable // FIXME cppcheck-suppress unreadVariable
// cppcheck-suppress invalidFunctionArg // cppcheck-suppress invalidFunctionArg
pMem = _alloca(-5); pMem = _alloca(-5);
} }
void uninitvar() void uninitvar()
{ {
HANDLE hSemaphore; HANDLE hSemaphore;
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
CloseHandle(hSemaphore); CloseHandle(hSemaphore);
skipping to change at line 860 skipping to change at line 861
error_t nullPointer__strncpy_s_l(char *strDest, size_t numberOfElements, const c har *strSource, size_t count, _locale_t locale) error_t nullPointer__strncpy_s_l(char *strDest, size_t numberOfElements, const c har *strSource, size_t count, _locale_t locale)
{ {
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer
(void)_strncpy_s_l(0, numberOfElements, strSource, count, locale); (void)_strncpy_s_l(0, numberOfElements, strSource, count, locale);
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer
(void)_strncpy_s_l(strDest, numberOfElements, 0, count, locale); (void)_strncpy_s_l(strDest, numberOfElements, 0, count, locale);
// no warning shall be shown for // no warning shall be shown for
return _strncpy_s_l(strDest, numberOfElements, strSource, count, locale); return _strncpy_s_l(strDest, numberOfElements, strSource, count, locale);
} }
class MyClass :public CObject {
DECLARE_DYNAMIC(MyClass)
DECLARE_DYNCREATE(MyClass)
DECLARE_SERIAL(MyClass)
public:
MyClass() {}
};
IMPLEMENT_DYNAMIC(MyClass, CObject)
IMPLEMENT_DYNCREATE(MyClass, CObject)
IMPLEMENT_SERIAL(MyClass,CObject, 42)
 End of changes. 3 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)