posix.cfg: utimes() is a wrapper for utime(), which is obsolescent. Set utimes() as obsolescent as well.

This commit is contained in:
orbitcowboy 2022-04-22 08:18:21 +02:00
parent 478aa6754b
commit 097438f308
2 changed files with 10 additions and 0 deletions

View File

@ -1695,6 +1695,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
<not-bool/>
<minsize type="value" value="2"/>
</arg>
<warn severity="style" reason="Obsolescent" alternatives="utimensat"/>
</function>
<!-- DIR *opendir(const char *name); -->
<function name="opendir">

View File

@ -226,6 +226,15 @@ void invalidFunctionArg_fseeko(FILE* stream, off_t offset, int origin)
(void)fseeko(stream, offset, SEEK_END);
}
int nullPointer_utimes(const char *path, const struct timeval times[2])
{
// cppcheck-suppress nullPointer
// cppcheck-suppress utimesCalled
(void)utimes(NULL, times);
// cppcheck-suppress utimesCalled
return utimes(path, times);
}
char * overlappingWriteFunction_stpcpy(char *src, char *dest)
{
// No warning shall be shown: