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

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Feb 16 22:44:09 PST 2023


sivachandra added a comment.

Mostly LGTM but I left a style comment inline.



================
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)                             \
+  {                                                                            \
----------------
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?


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