Skip to content

Commit 8aba11e

Browse files
chrchr-githubweb-flow
authored andcommitted
Fix #14564 FP AssignmentIntegerToAddress (MAKEINTRESOURCE() in windows.cfg) (cppcheck-opensource#8295)
1 parent c4fc683 commit 8aba11e

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

cfg/windows.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13345,9 +13345,9 @@ HFONT CreateFont(
1334513345
<define name="MiniDumpWithAvxXStateContext" value="0x0200000"/>
1334613346
<define name="MiniDumpWithIptTrace" value="0x0400000"/>
1334713347
<define name="MiniDumpValidTypeFlags" value="0x0800000"/>
13348-
<define name="MAKEINTRESOURCEA(i)" value="i"/>
13349-
<define name="MAKEINTRESOURCEW(i)" value="i"/>
13350-
<define name="MAKEINTRESOURCE(i)" value="i"/>
13348+
<define name="MAKEINTRESOURCEA(i)" value="((LPSTR)((ULONG_PTR)((WORD)(i))))"/>
13349+
<define name="MAKEINTRESOURCEW(i)" value="((LPWSTR)((ULONG_PTR)((WORD)(i))))"/>
13350+
<define name="MAKEINTRESOURCE(i)" value="((LPTSTR)((ULONG_PTR)((WORD)(i))))"/>
1335113351
<define name="FILE_ATTRIBUTE_ARCHIVE" value="0x20"/>
1335213352
<define name="FILE_ATTRIBUTE_COMPRESSED" value="0x800"/>
1335313353
<define name="FILE_ATTRIBUTE_DEVICE" value="0x40"/>

test/cfg/windows.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ std::string constVariable_GetModuleFileName(void) {
9393
return std::string{path};
9494
}
9595

96+
const TCHAR* constVariable_MAKEINTRESOURCE() { // #14564
97+
return MAKEINTRESOURCE(5 - 1);
98+
}
99+
96100
int stringCompare_mbscmp(const unsigned char *string1, const unsigned char *string2)
97101
{
98102
// cppcheck-suppress stringCompare

0 commit comments

Comments
 (0)