This is an archive of the discontinued LLVM Phabricator instance.

[libc] add fputs and puts
ClosedPublic

Authored by michaelrj on Sep 20 2022, 4:58 PM.

Details

Summary

add fputs, puts, and the EOF macro that they use.

Diff Detail

Event Timeline

michaelrj created this revision.Sep 20 2022, 4:58 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 20 2022, 4:58 PM
michaelrj requested review of this revision.Sep 20 2022, 4:58 PM
sivachandra added inline comments.Sep 21 2022, 9:41 AM
libc/src/stdio/fputs.cpp
29

Casting a unsigned value to a signed value can lead to incorrect sign. Why don't we just return 1 here?

libc/test/src/stdio/fileop_test.cpp
88

What are we testing for here?

michaelrj marked 2 inline comments as done.

add puts, address comments.

michaelrj retitled this revision from [libc] add fputs to [libc] add fputs and puts.Sep 21 2022, 10:51 AM
michaelrj edited the summary of this revision. (Show Details)
michaelrj added inline comments.
libc/src/stdio/fputs.cpp
29

that's fair, I've changed it to 0.

libc/test/src/stdio/fileop_test.cpp
88

I've reordered the assert and updated the comment.

sivachandra accepted this revision.Sep 21 2022, 10:59 AM
This revision is now accepted and ready to land.Sep 21 2022, 10:59 AM
This revision was landed with ongoing or failed builds.Sep 21 2022, 11:10 AM
This revision was automatically updated to reflect the committed changes.