[libc-commits] [PATCH] D143782: [libc] Prevent printf index mode crashes

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Feb 17 13:59:06 PST 2023


michaelrj added inline comments.


================
Comment at: libc/src/stdio/printf_core/parser.cpp:39
 #ifndef LIBC_COPT_PRINTF_DISABLE_INDEX_MODE
-#define GET_ARG_VAL_SIMPLEST(arg_type, index) get_arg_value<arg_type>(index)
+#define GET_ARG_VAL_SIMPLEST(dst, arg_type, index)                             \
+  {                                                                            \
----------------
sivachandra wrote:
> Readers would expect that a macro named `GET_<>` would be used a function macro which returns something. That aside, can this macro be replaced by a lambda?
I don't think this macro can be replaced by a lambda because it needs to also take a type, and templating lambdas is a C++20 feature from what I can tell.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143782/new/

https://reviews.llvm.org/D143782



More information about the libc-commits mailing list