llvm-project/compiler-rt/lib
Dimitry Andric bbba9d8c1b [XRay] fix more -Wformat warnings
Building xray with recent clang on a 64-bit system results in a number
of -Wformat warnings:

    compiler-rt/lib/xray/xray_allocator.h:70:11: warning: format specifies type 'int' but the argument has type '__sanitizer::uptr' (aka 'unsigned long') [-Wformat]
              RoundedSize, B);
              ^~~~~~~~~~~
    compiler-rt/lib/xray/xray_allocator.h:119:11: warning: format specifies type 'int' but the argument has type '__sanitizer::uptr' (aka 'unsigned long') [-Wformat]
              RoundedSize, B);
              ^~~~~~~~~~~

Since `__sanitizer::uptr` has the same size as `size_t`, these can be
fixed by using the printf specifier `%zu`.

    compiler-rt/lib/xray/xray_basic_logging.cpp:348:46: warning: format specifies type 'int' but the argument has type '__sanitizer::tid_t' (aka 'unsigned long long') [-Wformat]
          Report("Cleaned up log for TID: %d\n", GetTid());
                                          ~~     ^~~~~~~~
                                          %llu
    compiler-rt/lib/xray/xray_basic_logging.cpp:353:62: warning: format specifies type 'int' but the argument has type '__sanitizer::tid_t' (aka 'unsigned long long') [-Wformat]
          Report("Skipping buffer for TID: %d; Offset = %llu\n", GetTid(),
                                           ~~                    ^~~~~~~~
                                           %llu

Since `__sanitizer::tid_t` is effectively declared as `unsigned long
long`, these can be fixed by using the printf specifier `%llu`.

    compiler-rt/lib/xray/xray_basic_logging.cpp:354:14: warning: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                 TLD.BufferOffset);
                 ^~~~~~~~~~~~~~~~

Since `BufferOffset` is declared as `size_t`, this one can be fixed by
using `%zu` as a printf specifier.

    compiler-rt/lib/xray/xray_interface.cpp:172:50: warning: format specifies type 'int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Wformat]
        Report("Unsupported sled kind '%d' @%04x\n", Sled.Address, int(Sled.Kind));
                                       ~~            ^~~~~~~~~~~~
                                       %lu

Since ``xray::SledEntry::Address` is declared as `uint64_t`, this one
can be fixed by using `PRIu64`, and adding `<cinttypes>`.

    compiler-rt/lib/xray/xray_interface.cpp:308:62: warning: format specifies type 'long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
        Report("System page size is not a power of two: %lld\n", PageSize);
                                                        ~~~~     ^~~~~~~~
                                                        %zu
    compiler-rt/lib/xray/xray_interface.cpp:359:64: warning: format specifies type 'long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
        Report("Provided page size is not a power of two: %lld\n", PageSize);
                                                          ~~~~     ^~~~~~~~
                                                          %zu

Since `PageSize` is declared as `size_t`, these can be fixed by using
`%zu` as a printf specifier.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D114469
2021-12-04 20:01:20 +01:00
..
BlocksRuntime
asan [sanitizer] Support IsRssLimitExceeded in all sanitizers 2021-12-03 12:45:44 -08:00
builtins [compiler-rt][CMake] Support powerpcspe build 2021-11-26 13:29:06 -08:00
cfi cfi: fix more -Wformat warnings 2021-11-24 21:48:17 +01:00
crt [cmake] By default do not instrument compiler-rt if LLVM_BUILD_INSTRUMENTED_COVERAGE is ON 2021-11-09 10:59:25 +01:00
dfsan [sanitizer] Support IsRssLimitExceeded in all sanitizers 2021-12-03 12:45:44 -08:00
fuzzer [libFuzzer] Disable Msan on InternalStrnlen 2021-11-05 15:24:09 -07:00
gwp_asan Fix a few warnings (signed/unsigned comparison in gtest, and missing field initializers) 2021-10-16 22:43:57 -07:00
hwasan [sanitizer] Support IsRssLimitExceeded in all sanitizers 2021-12-03 12:45:44 -08:00
interception [compiler-rt] [windows] Add more assembly patterns for interception 2021-09-21 15:51:58 -07:00
lsan [sanitizer] Support IsRssLimitExceeded in all sanitizers 2021-12-03 12:45:44 -08:00
memprof [sanitizer] Support IsRssLimitExceeded in all sanitizers 2021-12-03 12:45:44 -08:00
msan [sanitizer] Support IsRssLimitExceeded in all sanitizers 2021-12-03 12:45:44 -08:00
orc [ORC][ORC-RT] Register type metadata from __swift5_types MachO section 2021-11-12 16:39:59 -08:00
profile [compiler-rt/profile] Include __llvm_profile_get_magic in module signature 2021-11-23 10:03:43 -08:00
safestack Revert "sanitizers: increase .clang-format columns to 100" 2021-07-28 09:40:21 +02:00
sanitizer_common [sanitizer] Hook up LZW into stack store 2021-12-03 23:38:41 -08:00
scudo [scudo] Handle mallinfo2 2021-11-16 19:29:37 -08:00
stats [compiler-rt] separate lsan, ubsan, stats configuration from SANITIZER_COMMON_SUPPORTED_OS 2021-11-10 19:16:20 -08:00
tsan [sanitizer] Support IsRssLimitExceeded in all sanitizers 2021-12-03 12:45:44 -08:00
ubsan [compiler-rt] separate lsan, ubsan, stats configuration from SANITIZER_COMMON_SUPPORTED_OS 2021-11-10 19:16:20 -08:00
ubsan_minimal [compiler-rt] separate lsan, ubsan, stats configuration from SANITIZER_COMMON_SUPPORTED_OS 2021-11-10 19:16:20 -08:00
xray [XRay] fix more -Wformat warnings 2021-12-04 20:01:20 +01:00
CMakeLists.txt [ORC-RT] Re-apply "Initial ORC Runtime directories and build..." with fixes. 2021-04-24 16:00:20 -07:00