[libc-commits] [PATCH] D159458: [libc] Fix printf %p format

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Sep 5 14:59:36 PDT 2023


michaelrj marked an inline comment as done.
michaelrj added inline comments.


================
Comment at: libc/src/stdio/printf_core/ptr_converter.h:25
+
   if (to_conv.conv_val_ptr == (void *)(nullptr)) {
+    constexpr char nullptr_str[] = "(nullptr)";
----------------
jhuber6 wrote:
> Why do we need to cast `nullptr` here? Also do we have the raw value itself? We could just check that for zero.
I'm not sure why that cast is there. I've removed it.

The reason we check the pointer is because the value is a pointer, so it gets stored in the pointer member.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159458



More information about the libc-commits mailing list