[libcxx] Make test case fmt specifiers more portable
authorBrian Cain <bcain@quicinc.com>
Fri, 25 Feb 2022 03:59:18 +0000 (19:59 -0800)
committerBrian Cain <bcain@quicinc.com>
Tue, 1 Mar 2022 20:07:23 +0000 (12:07 -0800)
commit9bf6e3e97e3ec91241cfd29030e80baeb9465b2b
tree10bb50d8a92b93c548dd6c4a009c621430517119
parent626ecef1fc57932d9fa97f45c8b1cbc0d83f8ebc
[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
libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp