================ @@ -101,6 +101,30 @@ void error_fwrite(void) { Ret = fwrite(0, 1, 10, F); // expected-warning {{Stream might be already closed}} } +void error_fgetc(void) { + FILE *F = tmpfile(); + if (!F) + return; + int Ret = fgetc(F); + if (0 <= Ret && Ret <= 255) { + clang_analyzer_eval(feof(F) || ferror(F)); // expected-warning {{FALSE}} + } else { + clang_analyzer_eval(Ret == EOF); // expected-warning {{TRUE}} ---------------- balazske wrote:
A line `clang_analyzer_eval(feof(F) || ferror(F)); // expected-warning {{FALSE}}` can be added to check that no state is produced when none of the state flags are set. https://github.com/llvm/llvm-project/pull/72627 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits