[all-commits] [llvm/llvm-project] 9bf6e3: [libcxx] Make test case fmt specifiers more portable

androm3da via All-commits all-commits at lists.llvm.org
Tue Mar 1 12:08:38 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9bf6e3e97e3ec91241cfd29030e80baeb9465b2b
      https://github.com/llvm/llvm-project/commit/9bf6e3e97e3ec91241cfd29030e80baeb9465b2b
  Author: Brian Cain <bcain at quicinc.com>
  Date:   2022-03-01 (Tue, 01 Mar 2022)

  Changed paths:
    M libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp

  Log Message:
  -----------
  [libcxx] Make test case fmt specifiers more portable

These printf()s fail to compile like so on hexagon:

.../tools/llvm-top/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp:94:23: error: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Werror,-Wformat]
        printf("%u ", elem);
                ~~    ^~~~
                %lu
.../tools/llvm-top/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp:569:56: error: format specifies type 'unsigned int' but the argument has type 'uint32_t' (aka 'unsigned long') [-Werror,-Wformat]
        fprintf(stderr, "%s failed for 0x%08X\n", msg, bits);
                                         ~~~~          ^~~~
                                         %08lX
.../tools/llvm-top/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp:1096:43: error: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Werror,-Wformat]
    printf("Randomized test cases: %u\n", PrefixesToTest * Fractions);
                                   ~~     ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                   %lu

Differential Revision: https://reviews.llvm.org/D120532




More information about the All-commits mailing list