Fixed false positive seekOnAppendedFile if FILE* is reused (#6566)
This commit is contained in:
parent
05b5275110
commit
3971f8625f
|
@ -267,7 +267,8 @@ void CheckIO::checkFileUsage()
|
|||
f.append_mode = Filepointer::APPEND_EX;
|
||||
else
|
||||
f.append_mode = Filepointer::APPEND;
|
||||
}
|
||||
} else
|
||||
f.append_mode = Filepointer::UNKNOWN_AM;
|
||||
f.mode_indent = indent;
|
||||
break;
|
||||
case Filepointer::POSITIONING:
|
||||
|
|
|
@ -637,6 +637,14 @@ private:
|
|||
" fflush(f);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str()); // #5578
|
||||
|
||||
check("void foo() {\n"
|
||||
" FILE* f = fopen(\"\", \"a\");\n"
|
||||
" fclose(f);\n"
|
||||
" f = fopen(\"\", \"r\");\n"
|
||||
" fseek(f, 0, SEEK_SET);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str()); // #6566
|
||||
}
|
||||
|
||||
void fflushOnInputStream() {
|
||||
|
|
Loading…
Reference in New Issue