Fixed Ticket 1001 - std.cfg: Invalid parameters for fseek()

This commit is contained in:
orbitcowboy 2022-02-06 16:05:14 +01:00
parent 974dd5d49f
commit fa776051e9
2 changed files with 18 additions and 0 deletions

View File

@ -2186,6 +2186,7 @@
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<valid>0:2</valid>
</arg>
</function>
<!-- int fsetpos(FILE *stream, const fpos_t *ptr); -->

View File

@ -1231,6 +1231,23 @@ void uninitvar_fseek(void)
(void)std::fseek(stream,offset,origin);
}
void invalidFunctionArg_fseek(FILE* stream, long int offset, int origin)
{
// cppcheck-suppress invalidFunctionArg
(void)std::fseek(stream, offset, -1);
// cppcheck-suppress invalidFunctionArg
(void)std::fseek(stream, offset, 3);
// cppcheck-suppress invalidFunctionArg
(void)std::fseek(stream, offset, 42+SEEK_SET);
// cppcheck-suppress invalidFunctionArg
(void)std::fseek(stream, offset, SEEK_SET+42);
// No warning is expected for
(void)std::fseek(stream, offset, origin);
(void)std::fseek(stream, offset, SEEK_SET);
(void)std::fseek(stream, offset, SEEK_CUR);
(void)std::fseek(stream, offset, SEEK_END);
}
void uninitvar_fsetpos(void)
{
FILE* stream;