[libc-commits] [PATCH] D134328: [libc] add fputs

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Sep 21 09:41:43 PDT 2022


sivachandra added inline comments.


================
Comment at: libc/src/stdio/fputs.cpp:28
+  }
+  return static_cast<int>(str_len);
+}
----------------
Casting a unsigned value to a signed value can lead to incorrect sign. Why don't we just return 1 here?


================
Comment at: libc/test/src/stdio/fileop_test.cpp:88
+  // success.
+  ASSERT_LE(0, __llvm_libc::fputs(CONTENT, file));
+
----------------
What are we testing for here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134328



More information about the libc-commits mailing list