[libcxx-commits] [PATCH] D120532: [libcxx] Make format specifiers more portable

Brian Cain via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 1 12:08:31 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9bf6e3e97e3e: [libcxx] Make test case fmt specifiers more portable (authored by androm3da).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120532

Files:
  libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp


Index: libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
===================================================================
--- libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
+++ libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
@@ -91,7 +91,7 @@
 
     puts("SEED DATA:");
     for (const auto& elem : vec) {
-        printf("%u ", elem);
+        printf("%zu ", static_cast<size_t>(elem));
     }
     printf("\n");
 
@@ -566,7 +566,7 @@
 
 void assert_message_bits(const bool b, const char* const msg, const uint32_t bits) {
     if (!b) {
-        fprintf(stderr, "%s failed for 0x%08X\n", msg, bits);
+        fprintf(stderr, "%s failed for 0x%08zX\n", msg, static_cast<size_t>(bits));
         fprintf(stderr, "This is a randomized test.\n");
         fprintf(stderr, "DO NOT IGNORE/RERUN THIS FAILURE.\n");
         fprintf(stderr, "You must report it to the STL maintainers.\n");
@@ -1093,7 +1093,7 @@
     const long long ms = chrono::duration_cast<chrono::milliseconds>(finish - start).count();
 
     puts("PASS");
-    printf("Randomized test cases: %u\n", PrefixesToTest * Fractions);
+    printf("Randomized test cases: %zu\n", static_cast<size_t>(PrefixesToTest * Fractions));
     printf("Total time: %lld ms\n", ms);
 
     if (ms < 3'000) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120532.412199.patch
Type: text/x-patch
Size: 1287 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220301/1b3538c8/attachment.bin>


More information about the libcxx-commits mailing list