[libc-commits] [PATCH] D156923: [libc] Add nullptr check option to printf %s

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Aug 2 11:54:28 PDT 2023


lntue accepted this revision.
lntue added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/test/src/stdio/sprintf_test.cpp:101
+#ifndef LIBC_COPT_PRINTF_NO_NULLPTR_CHECKS
+  written = __llvm_libc::sprintf(buff, "%s", nullptr);
+  EXPECT_EQ(written, 4);
----------------
Also add the expectation for this output when `LIBC_COPT_PRINTF_NO_NULLPTR_CHECKS` is set.


================
Comment at: libc/test/src/stdio/sprintf_test.cpp:2791
+#ifndef LIBC_COPT_PRINTF_NO_NULLPTR_CHECKS
   written = __llvm_libc::sprintf(buff, "abc123%n", nullptr);
   EXPECT_LT(written, 0);
----------------
Also add the expectation for this output when `LIBC_COPT_PRINTF_NO_NULLPTR_CHECKS` is set.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156923



More information about the libc-commits mailing list