diff --git a/cfg/std.cfg b/cfg/std.cfg index ea6be2cc7..c69495d21 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -2186,6 +2186,7 @@ + 0:2 diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 94329f860..5aeebcab2 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -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;