================ @@ -299,6 +299,21 @@ void error_fseek_0(void) { fclose(F); } +void error_fflush(void) { + FILE *F = tmpfile(); + int Ret; + fflush(NULL); // no-warning + if (!F) { + if ((Ret = fflush(F)) != EOF) // no-warning + clang_analyzer_eval(Ret == 0); // expected-warning {{TRUE}} + return; + } + if ((Ret = fflush(F)) != 0) + clang_analyzer_eval(Ret == EOF); // expected-warning {{TRUE}} + fclose(F); + fflush(F); // expected-warning {{Stream might be already closed}} +} + ---------------- balazske wrote:
If the stream error state is reset by `fflush` another test is needed to check if the reset works. https://github.com/llvm/llvm-project/pull/74296 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits