From ad709a752daa6aebf03a3d34fc5b2e24a8a0dbea Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Thu, 16 Jun 2022 10:12:23 -0700 Subject: [PATCH] [libc][obvious] fix sign warning in file_writer In the sign writer, a size_t was being compared to an int. This patch casts the size_t to an int so that the comparison doesn't cause a sign comparison warning. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D127984 --- libc/src/stdio/printf_core/file_writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/src/stdio/printf_core/file_writer.cpp b/libc/src/stdio/printf_core/file_writer.cpp index 3f84ddd..b87ae62 100644 --- a/libc/src/stdio/printf_core/file_writer.cpp +++ b/libc/src/stdio/printf_core/file_writer.cpp @@ -15,7 +15,7 @@ namespace printf_core { int FileWriter::write(const char *__restrict to_write, size_t len) { int written = file->write_unlocked(to_write, len); - if (written != len) + if (written != static_cast(len)) written = -1; if (file->error_unlocked()) written = -2; -- 2.7.4