windows.cfg: Add lstrlen() configuration and tests. (#1239)
Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/ms647492(v=vs.85).aspx
This commit is contained in:
parent
e2ea82908a
commit
aa3722feea
@ -4220,6 +4220,18 @@ HFONT CreateFont(
|
|||||||
<strz/>
|
<strz/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- int WINAPI lstrlen(_In_ LPCTSTR lpString); -->
|
||||||
|
<function name="lstrlen,lstrlenA,lstrlenW">
|
||||||
|
<use-retval/>
|
||||||
|
<returnValue type="int"/>
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<leak-ignore/>
|
||||||
|
<warn severity="style" alternatives="StringCbLength,StringCchLength">Due to security concerns it is not recommended to use this function, see MSDN for details.</warn>
|
||||||
|
<arg nr="1">
|
||||||
|
<not-uninit/>
|
||||||
|
<strz/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
<!--HANDLE WINAPI CreateSemaphore(
|
<!--HANDLE WINAPI CreateSemaphore(
|
||||||
_In_opt_ LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
|
_In_opt_ LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
|
||||||
_In_ LONG lInitialCount,
|
_In_ LONG lInitialCount,
|
||||||
|
@ -163,6 +163,11 @@ void validCode()
|
|||||||
HLOCAL pLocalAlloc = LocalAlloc(1, 2);
|
HLOCAL pLocalAlloc = LocalAlloc(1, 2);
|
||||||
LocalFree(pLocalAlloc);
|
LocalFree(pLocalAlloc);
|
||||||
|
|
||||||
|
// cppcheck-suppress lstrlenCalled
|
||||||
|
(void)lstrlen(bufTC);
|
||||||
|
// cppcheck-suppress lstrlenCalled
|
||||||
|
(void)lstrlen(NULL);
|
||||||
|
|
||||||
// Intrinsics
|
// Intrinsics
|
||||||
__noop();
|
__noop();
|
||||||
__noop(1, "test", NULL);
|
__noop(1, "test", NULL);
|
||||||
@ -485,6 +490,10 @@ void ignoredReturnValue()
|
|||||||
|
|
||||||
// cppcheck-suppress ignoredReturnValue
|
// cppcheck-suppress ignoredReturnValue
|
||||||
_fileno(stdio);
|
_fileno(stdio);
|
||||||
|
|
||||||
|
// cppcheck-suppress lstrlenCalled
|
||||||
|
// cppcheck-suppress ignoredReturnValue
|
||||||
|
lstrlen(TEXT("test"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void invalidFunctionArg()
|
void invalidFunctionArg()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user