Skip to content

Commit

Permalink
Merge branch 'danmar:main' into fix_noreturn_msvc_warning
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanVK committed Nov 11, 2023
2 parents 79b6525 + f4df28d commit 9d2d226
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cfg/windows.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4800,6 +4800,23 @@ HFONT CreateFont(
<not-bool/>
</arg>
</function>
<!-- HANDLE OpenProcess([in] DWORD dwDesiredAccess,
[in] BOOL bInheritHandle,
[in] DWORD dwProcessId); -->
<function name="OpenProcess">
<use-retval/>
<noreturn>false</noreturn>
<returnValue type="HANDLE"/>
<arg nr="1" direction="in">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
</arg>
</function>
<!--VOID WINAPI FreeLibraryAndExitThread(
_In_ HMODULE hModule,
_In_ DWORD dwExitCode);-->
Expand Down
7 changes: 7 additions & 0 deletions test/cfg/windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
#include <atlstr.h>
#include <string>

void resourceLeak_OpenProcess(const DWORD dwDesiredAccess, const BOOL bInheritHandle, const DWORD dwProcessId)
{
HANDLE proc = OpenProcess(dwDesiredAccess, bInheritHandle, dwProcessId);
if (proc != INVALID_HANDLE_VALUE) {}
// cppcheck-suppress resourceLeak
}

/// https://learn.microsoft.com/en-us/windows/console/flushconsoleinputbuffer
BOOL unreachableCode_FlushConsoleInputBuffer(int &val)
{
Expand Down

0 comments on commit 9d2d226

Please sign in to comment.