windows.cfg: deprecate '_alloca()'. Ref. https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/alloca?view=msvc-170
This commit is contained in:
parent
cfa5cd4849
commit
1934386738
|
@ -5369,8 +5369,7 @@ HFONT CreateFont(
|
||||||
<not-bool/>
|
<not-bool/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
<!--void *_malloca(
|
<!--void *_malloca(size_t size);-->
|
||||||
size_t size);-->
|
|
||||||
<function name="_malloca">
|
<function name="_malloca">
|
||||||
<returnValue type="void *"/>
|
<returnValue type="void *"/>
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
|
@ -5380,8 +5379,7 @@ HFONT CreateFont(
|
||||||
<valid>0:</valid>
|
<valid>0:</valid>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
<!--void *_alloca(
|
<!--void *_alloca(size_t size);-->
|
||||||
size_t size);-->
|
|
||||||
<function name="_alloca">
|
<function name="_alloca">
|
||||||
<returnValue type="void *"/>
|
<returnValue type="void *"/>
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
@ -5390,9 +5388,9 @@ HFONT CreateFont(
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
<valid>0:</valid>
|
<valid>0:</valid>
|
||||||
</arg>
|
</arg>
|
||||||
|
<warn severity="style" alternatives="_malloca">This function is deprecated because a more secure version is available '_malloca'.</warn>
|
||||||
</function>
|
</function>
|
||||||
<!--void _freea(
|
<!--void _freea(void *memblock);-->
|
||||||
void *memblock);-->
|
|
||||||
<function name="_freea">
|
<function name="_freea">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<returnValue type="void"/>
|
<returnValue type="void"/>
|
||||||
|
|
|
@ -260,6 +260,7 @@ void validCode()
|
||||||
void *pMem1 = _malloca(1);
|
void *pMem1 = _malloca(1);
|
||||||
_freea(pMem1);
|
_freea(pMem1);
|
||||||
// Memory from _alloca must not be freed
|
// Memory from _alloca must not be freed
|
||||||
|
// cppcheck-suppress _allocaCalled
|
||||||
void *pMem2 = _alloca(10);
|
void *pMem2 = _alloca(10);
|
||||||
memset(pMem2, 0, 10);
|
memset(pMem2, 0, 10);
|
||||||
|
|
||||||
|
@ -683,6 +684,7 @@ void ignoredReturnValue()
|
||||||
// cppcheck-suppress leakReturnValNotUsed
|
// cppcheck-suppress leakReturnValNotUsed
|
||||||
_malloca(10);
|
_malloca(10);
|
||||||
// cppcheck-suppress ignoredReturnValue
|
// cppcheck-suppress ignoredReturnValue
|
||||||
|
// cppcheck-suppress _allocaCalled
|
||||||
_alloca(5);
|
_alloca(5);
|
||||||
|
|
||||||
// cppcheck-suppress ignoredReturnValue
|
// cppcheck-suppress ignoredReturnValue
|
||||||
|
@ -745,6 +747,7 @@ void invalidFunctionArg()
|
||||||
_freea(pMem);
|
_freea(pMem);
|
||||||
// FIXME cppcheck-suppress unreadVariable
|
// FIXME cppcheck-suppress unreadVariable
|
||||||
// cppcheck-suppress invalidFunctionArg
|
// cppcheck-suppress invalidFunctionArg
|
||||||
|
// cppcheck-suppress _allocaCalled
|
||||||
pMem = _alloca(-5);
|
pMem = _alloca(-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue