windows.cfg: Added support for more interfaces.

This commit is contained in:
orbitcowboy 2019-10-21 10:09:20 +02:00
parent 6cf0aed737
commit 24d6794ba6
3 changed files with 84 additions and 0 deletions

View File

@ -4049,6 +4049,16 @@ HFONT CreateFont(
<not-uninit/>
</arg>
</function>
<!-- error_t _get_timezone( long* seconds); -->
<!-- error_t _get_daylight( int* hours ); -->
<function name="_get_timezone,_get_daylight">
<noreturn>false</noreturn>
<returnValue type="error_t"/>
<leak-ignore/>
<arg nr="1" direction="out">
<not-null/>
</arg>
</function>
<!-- size_t _strftime_l(char *strDest, size_t maxsize, const char *format, const struct tm *timeptr, _locale_t locale); -->
<!-- size_t _wcsftime_l(wchar_t *strDest, size_t maxsize, const wchar_t *format, const struct tm *timeptr, _locale_t locale); -->
<function name="_strftime_l,_wcsftime_l">
@ -5995,6 +6005,18 @@ HFONT CreateFont(
<not-bool/>
</arg>
</function>
<!-- int _chdir(const char *path); -->
<!-- int _wchdir(const wchar_t *path); -->
<function name="_chdir,_wchdir,_tchdir">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="int"/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
<not-bool/>
</arg>
</function>
<!-- int _finite(double x);
int _finitef(float x); /* x64 and ARM/ARM64 only */ -->
<function name="_finite,_finitef">

View File

@ -23,6 +23,26 @@
#include <syslog.h>
#include <stdarg.h>
void uninitvar_putenv(char * envstr)
{
// No warning is expected
(void)putenv(envstr);
char * p;
// cppcheck-suppress uninitvar
(void)putenv(p);
}
void nullPointer_putenv(char * envstr)
{
// No warning is expected
(void)putenv(envstr);
char * p=NULL;
// cppcheck-suppress nullPointer
(void)putenv(p);
}
void memleak_scandir(void)
{
struct dirent **namelist;

View File

@ -10,6 +10,28 @@
#include <windows.h>
#include <direct.h>
#include <stdlib.h>
#include <time.h>
void uninitvar__putenv(char * envstr)
{
// No warning is expected
(void)_putenv(envstr);
char * p;
// cppcheck-suppress uninitvar
(void)_putenv(p);
}
void nullPointer__putenv(char * envstr)
{
// No warning is expected
(void)_putenv(envstr);
char * p=NULL;
// cppcheck-suppress nullPointer
(void)_putenv(p);
}
void invalidFunctionArg__getcwd(char * buffer)
{
@ -22,6 +44,26 @@ void invalidFunctionArg__getcwd(char * buffer)
free(buffer);
}
void nullPointer__get_timezone(long *sec)
{
// No warning is expected
(void)_get_timezone(sec);
long *pSec = NULL;
// cppcheck-suppress nullPointer
(void)_get_timezone(pSec);
}
void nullPointer__get_daylight(int *h)
{
// No warning is expected
(void)_get_daylight(h);
int *pHours = NULL;
// cppcheck-suppress nullPointer
(void)_get_daylight(pHours);
}
void validCode()
{
DWORD dwordInit = 0;