HomePhabricator

[libcxx] Fix printf formats in two tests.

Authored by simon_tatham on Oct 16 2020, 5:47 AM.

Description

[libcxx] Fix printf formats in two tests.

rGcc69d211d0d65d7b introduced several uses of printf with format
directives %lu and %ld to format values of type size_t and
ptrdiff_t respectively.

That doesn't reliably work in all C implementations, because those
types aren't necessarily the same thing as 'long int': sometimes
they're not even the same size, and when they are the same size, they
might be officially defined as int rather than long (for example),
which causes clang to emit a diagnostic for the mismatch.

C has special-purpose printf modifier letters for these two types, so
it's safer to use them. Changed all %lu on size_t to %zu, and
all %ld on ptrdiff_t to %td.

Reviewed By: ldionne, #libc

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

Details

Committed
simon_tathamOct 16 2020, 5:47 AM
Reviewer
Restricted Project
Differential Revision
D89545: [libcxx] Fix printf formats in two tests.
Parents
rG0a7f41739fd9: Revert "[llvm-cov] don't include all source files when provided source files…
Branches
Unknown
Tags
Unknown