This is an archive of the discontinued LLVM Phabricator instance.

[libc] add printf pointer conv
ClosedPublic

Authored by michaelrj on Jun 16 2022, 11:26 AM.

Details

Summary

The pointer converter handles the %p conversion. It uses the hex
converter for most of the conversion.

Diff Detail

Event Timeline

michaelrj created this revision.Jun 16 2022, 11:26 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 16 2022, 11:26 AM
michaelrj requested review of this revision.Jun 16 2022, 11:26 AM

add converter test

lntue added a comment.Jun 17 2022, 8:02 AM

Is the new header ptr_converter.h needed to be added to converter object library in CMakeLists.txt?

yes, I've added ptr_converter to the CMake now

sivachandra accepted this revision.Jun 17 2022, 10:28 AM
sivachandra added inline comments.
libc/test/src/stdio/sprintf_test.cpp
361

Whats the point of this test?

This revision is now accepted and ready to land.Jun 17 2022, 10:28 AM
michaelrj marked an inline comment as done.Jun 17 2022, 5:17 PM
michaelrj added inline comments.
libc/test/src/stdio/sprintf_test.cpp
361

I want to make sure it writes something for a real pointer, but since I don't know the value of the pointer before runtime I can't fix the return value. I use the other cases to check that it actually returns correct values.

This revision was automatically updated to reflect the committed changes.
michaelrj marked an inline comment as done.