Follow up of https://reviews.llvm.org/D113099
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| compiler-rt/lib/xray/xray_x86_64.cpp | ||
|---|---|---|
| 154 | looks like xray prefers reinterpret_cast, can you fix this? | |
| compiler-rt/lib/xray/xray_x86_64.cpp | ||
|---|---|---|
| 154 | Sure. | |
Comment Actions
Hi,
Does this warn about anything other than passing T* for %p? Is this warning ever useful? I would say printf accepts any type T* for %p. It prints them perfectly well.
TSan runtime with DPrintf enabled is not clean.
Adding casts for all these cases is lots of verbosity (we prefer C++ casts now I think). And I don't see any particular value we will get for all that additional verbosity...
[543/1320] Building CXX object projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_fd.cpp.o
compiler-rt/lib/tsan/rtl/tsan_fd.cpp:165:55: warning: format specifies type 'void *' but the argument has type '__tsan::FdSync *' [-Wformat-pedantic]
DPrintf("#%d: FdAcquire(%d) -> %p\n", thr->tid, fd, s);
~~ ^
compiler-rt/lib/tsan/rtl/tsan_fd.cpp:176:55: warning: format specifies type 'void *' but the argument has type '__tsan::FdSync *' [-Wformat-pedantic]
DPrintf("#%d: FdRelease(%d) -> %p\n", thr->tid, fd, s);
~~ ^
2 warnings generated.
[547/1320] Linking CXX shared library lib/clang/14.0.0/lib/linux/libclang_rt.asan-x86_64.so
/usr/bin/ld: warning: -z gnu-version-script-compat ignored
[578/1320] Building CXX object projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_rtl.cpp.o
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:84:59: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
DPrintf("#%d: TracePartAlloc: part=%p\n", thr->tid, part);
~~ ^~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:818:11: warning: format specifies type 'void *' but the argument has type '__tsan::Trace *' [-Wformat-pedantic]
trace, trace->parts.Front(), part, pos);
^~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:818:18: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace, trace->parts.Front(), part, pos);
^~~~~~~~~~~~~~~~~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:818:40: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace, trace->parts.Front(), part, pos);
^~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:818:46: warning: format specifies type 'void *' but the argument has type '__tsan::Event *' [-Wformat-pedantic]
trace, trace->parts.Front(), part, pos);
^~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:913:11: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace->parts.Front(), trace->parts.Back(),
^~~~~~~~~~~~~~~~~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:913:33: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace->parts.Front(), trace->parts.Back(),
^~~~~~~~~~~~~~~~~~~
7 warnings generated.
[579/1320] Building CXX object projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-dynamic-x86_64.dir/rtl/tsan_fd.cpp.o
compiler-rt/lib/tsan/rtl/tsan_fd.cpp:165:55: warning: format specifies type 'void *' but the argument has type '__tsan::FdSync *' [-Wformat-pedantic]
DPrintf("#%d: FdAcquire(%d) -> %p\n", thr->tid, fd, s);
~~ ^
compiler-rt/lib/tsan/rtl/tsan_fd.cpp:176:55: warning: format specifies type 'void *' but the argument has type '__tsan::FdSync *' [-Wformat-pedantic]
DPrintf("#%d: FdRelease(%d) -> %p\n", thr->tid, fd, s);
~~ ^
2 warnings generated.
[582/1320] Building CXX object projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_rtl_report.cpp.o
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:468:71: warning: format specifies type 'void *' but the argument has type '__tsan::Trace *' [-Wformat-pedantic]
DPrintf2("RestoreStack: tid=%d trace=%p no trace parts\n", tid, trace);
~~ ^~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:484:12: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace->parts.Front(), last_part, last_pos);
^~~~~~~~~~~~~~~~~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:484:34: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace->parts.Front(), last_part, last_pos);
^~~~~~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:484:45: warning: format specifies type 'void *' but the argument has type '__tsan::Event *' [-Wformat-pedantic]
trace->parts.Front(), last_part, last_pos);
^~~~~~~~
4 warnings generated.
[610/1320] Building CXX object projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-dynamic-x86_64.dir/rtl/tsan_rtl.cpp.o
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:84:59: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
DPrintf("#%d: TracePartAlloc: part=%p\n", thr->tid, part);
~~ ^~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:818:11: warning: format specifies type 'void *' but the argument has type '__tsan::Trace *' [-Wformat-pedantic]
trace, trace->parts.Front(), part, pos);
^~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:818:18: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace, trace->parts.Front(), part, pos);
^~~~~~~~~~~~~~~~~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:818:40: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace, trace->parts.Front(), part, pos);
^~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:818:46: warning: format specifies type 'void *' but the argument has type '__tsan::Event *' [-Wformat-pedantic]
trace, trace->parts.Front(), part, pos);
^~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:913:11: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace->parts.Front(), trace->parts.Back(),
^~~~~~~~~~~~~~~~~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:913:33: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace->parts.Front(), trace->parts.Back(),
^~~~~~~~~~~~~~~~~~~
7 warnings generated.
[615/1320] Building CXX object projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-dynamic-x86_64.dir/rtl/tsan_rtl_report.cpp.o
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:468:71: warning: format specifies type 'void *' but the argument has type '__tsan::Trace *' [-Wformat-pedantic]
DPrintf2("RestoreStack: tid=%d trace=%p no trace parts\n", tid, trace);
~~ ^~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:484:12: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace->parts.Front(), last_part, last_pos);
^~~~~~~~~~~~~~~~~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:484:34: warning: format specifies type 'void *' but the argument has type '__tsan::TracePart *' [-Wformat-pedantic]
trace->parts.Front(), last_part, last_pos);
^~~~~~~~~
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:484:45: warning: format specifies type 'void *' but the argument has type '__tsan::Event *' [-Wformat-pedantic]
trace->parts.Front(), last_part, last_pos);
^~~~~~~~
looks like xray prefers reinterpret_cast, can you fix this?