posix.cfg: Improved configuration of lseek().
This commit is contained in:
parent
2dea968ec5
commit
bd1d8ea7b8
|
@ -3394,6 +3394,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
|||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<not-bool/>
|
||||
<valid>0:2</valid>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); -->
|
||||
|
|
|
@ -29,6 +29,26 @@
|
|||
#include <wchar.h>
|
||||
#include <string.h>
|
||||
|
||||
void invalidFunctionArg_lseek(int fd, off_t offset, int origin)
|
||||
{
|
||||
// cppcheck-suppress invalidFunctionArg
|
||||
(void)lseek(-1, offset, SEEK_SET);
|
||||
// cppcheck-suppress invalidFunctionArg
|
||||
(void)lseek(fd, offset, -1);
|
||||
// cppcheck-suppress invalidFunctionArg
|
||||
(void)lseek(fd, offset, 3);
|
||||
// cppcheck-suppress invalidFunctionArg
|
||||
(void)lseek(fd, offset, 42+SEEK_SET);
|
||||
// cppcheck-suppress invalidFunctionArg
|
||||
(void)lseek(fd, offset, SEEK_SET+42);
|
||||
// No warning is expected for
|
||||
(void)lseek(0, offset, origin);
|
||||
(void)lseek(fd, offset, origin);
|
||||
(void)lseek(fd, offset, SEEK_SET);
|
||||
(void)lseek(fd, offset, SEEK_CUR);
|
||||
(void)lseek(fd, offset, SEEK_END);
|
||||
}
|
||||
|
||||
void invalidFunctionArg_fseeko(FILE* stream, off_t offset, int origin)
|
||||
{
|
||||
// cppcheck-suppress invalidFunctionArg
|
||||
|
|
Loading…
Reference in New Issue