[libc-commits] [PATCH] D117258: [WIP][libc] add core parsing for printf

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jan 13 15:10:51 PST 2022


michaelrj created this revision.
michaelrj added reviewers: sivachandra, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added a project: libc-project.
michaelrj requested review of this revision.

Add the core parsing logic to handle printf, as well as an entrypoint
for sprintf. Most of the conversions are not yet done (the only ones
that are complete are % c s and n), but adding them should be simple
from the printf side, though the business logic will be complex.

Currently broken:

- StringConversionWithWidth segfaults if there are more than 4 sprintf tests in it. This is because somehow on the fourth call, the pointer in "string_arg" is somehow defined as the value of the characters in the name of the test. I have no idea how, this makes no sense.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117258

Files:
  libc/config/linux/x86_64/entrypoints.txt
  libc/src/CMakeLists.txt
  libc/src/stdio/CMakeLists.txt
  libc/src/stdio/printf_conv_core.h
  libc/src/stdio/printf_impl.h
  libc/src/stdio/sprintf.cpp
  libc/src/stdio/sprintf.h
  libc/test/src/CMakeLists.txt
  libc/test/src/stdio/CMakeLists.txt
  libc/test/src/stdio/sprintf_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117258.399805.patch
Type: text/x-patch
Size: 18099 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220113/bf109d32/attachment.bin>


More information about the libc-commits mailing list