From 817dacfc77d22d141178cbe3746a88eac62ef8a4 Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Wed, 9 Apr 2025 15:17:26 +0200 Subject: [PATCH] Fix clang-tidy: function 'rewind' has no error detection; 'fseek' should be used instead [bugprone-unsafe-functions,-warnings-as-errors] (#5265) --- testing/file_test/run_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/file_test/run_test.cpp b/testing/file_test/run_test.cpp index c01d88176394..db987fe5d1a7 100644 --- a/testing/file_test/run_test.cpp +++ b/testing/file_test/run_test.cpp @@ -122,7 +122,7 @@ auto RunTestFile(const FileTestBase& test_base, bool dump_output, input_stream = tmpfile(); fwrite(split->content.c_str(), sizeof(char), split->content.size(), input_stream); - rewind(input_stream); + CARBON_CHECK(!fseek(input_stream, 0, SEEK_SET)); } else if (!fs->addFile(split->filename, /*ModificationTime=*/0, llvm::MemoryBuffer::getMemBuffer( split->content, split->filename,