[libc-commits] [PATCH] D157535: [libc] Fix printf %f bugs

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Aug 9 14:28:44 PDT 2023


sivachandra added inline comments.


================
Comment at: libc/test/src/stdio/sprintf_test.cpp:1283
 
+  // Found via fuzzing
+
----------------
Remove.


================
Comment at: libc/test/src/stdio/sprintf_test.cpp:1285
+
+  written = __llvm_libc::sprintf(buff, "%.9f", 1.9999999999999514);
+  ASSERT_STREQ_LEN(written, buff, "2.000000000");
----------------
Add a comment describing the "why" of the expected result. In a way it is obvious I think, but will help people who do not remember what the `%.9f` means.

Same for the tests below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157535



More information about the libc-commits mailing list