[libc-commits] [PATCH] D134328: [libc] add fputs and puts
Michael Jones via Phabricator via libc-commits
libc-commits at lists.llvm.org
Wed Sep 21 10:51:17 PDT 2022
michaelrj added inline comments.
================
Comment at: libc/src/stdio/fputs.cpp:28
+ }
+ return static_cast<int>(str_len);
+}
----------------
sivachandra wrote:
> Casting a unsigned value to a signed value can lead to incorrect sign. Why don't we just return 1 here?
that's fair, I've changed it to 0.
================
Comment at: libc/test/src/stdio/fileop_test.cpp:88
+ // success.
+ ASSERT_LE(0, __llvm_libc::fputs(CONTENT, file));
+
----------------
sivachandra wrote:
> What are we testing for here?
I've reordered the assert and updated the comment.
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