[libc-commits] [PATCH] D125939: [libc] add fprintf and file_writer

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue May 31 13:47:55 PDT 2022


sivachandra accepted this revision.
sivachandra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/test/src/stdio/fprintf_test.cpp:29
+  written =
+      __llvm_libc::fprintf(file, "A simple string with no conversions.\n");
+  EXPECT_EQ(written, 37);
----------------
Put this is a common `constexpr char[]`.


================
Comment at: libc/test/src/stdio/fprintf_test.cpp:32
+
+  written = __llvm_libc::fprintf(file, "%s", "1234567890\n");
+  EXPECT_EQ(written, 11);
----------------
Same here.


================
Comment at: libc/test/src/stdio/fprintf_test.cpp:44
+  char data[50];
+  ASSERT_EQ(__llvm_libc::fread(data, 1, 37, file), size_t(37));
+  data[37] = '\0';
----------------
Instead of 37, use `sizeof(...)`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125939/new/

https://reviews.llvm.org/D125939



More information about the libc-commits mailing list