This patch adds the core parsing for printf in the PrintfParser class.
It does not, however, include the conversion or string construction
parts that are necessary for a complete printf. Those will be added in a
later patch.
Details
- Reviewers
sivachandra lntue
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Few highlevel comments for now. Once they are addressed, I will comment on the details.
libc/src/stdio/printf_parser.h | ||
---|---|---|
1 | Most of this class should move to a .cpp file. | |
33–34 | We should do it now as a prerequisite. Also, instead of a vector, it an "object-store" might be useful in general. | |
317 | While holding onto a va_list pointer while on the same stack should be OK, saving it as another object's state can lead to surprising results. Also, it is not clear as to who is responsible for calling va_start and va_end. Can we perhaps create a RAII class around va_list so that we don't have to worry about things like this? Also, it is better to have an API which does not require storing the varargs. | |
libc/test/src/stdio/printf_parser_test.cpp | ||
1 | Couple of general comments:
|
libc/src/stdio/printf_format_struct.h | ||
---|---|---|
17 | Shall none be all CAPS? |
This version of printf has issues that are not easily fixed. It is being redesigned, and a new patch will be made.
Shall none be all CAPS?