%p reported prints upper case hex chars on Windows.
The fix is to switch to using %#lx
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
compiler-rt/test/asan/TestCases/wild_pointer.cpp | ||
---|---|---|
17 | As far as I know, Windows doesn't print the 0x, which makes the [[ADDR]] capture fail I think. And then the CHECK on the next line would fail too since [[ADDR]] doesn't include the 0x. So this comment should say "Windows omits the 0x prefix" instead, since that's the problem. unsigned long is 32-bit on 64-bit Windows (https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models) so if you want to keep the current approach you want to use uintptr_t and PRIxPTR from stdint.h and inttypes.h respectively: #include <inttypes.h> #include <stdint.h> #include <stdio.h> int main() { printf("%#" PRIxPTR "\n", (uintptr_t)1231); } (Unrelated: Please upload diffs with -U9999) |
compiler-rt/test/asan/TestCases/wild_pointer.cpp | ||
---|---|---|
17 |
This is the full file (it's not being truncated ...) |
As far as I know, Windows doesn't print the 0x, which makes the [[ADDR]] capture fail I think. And then the CHECK on the next line would fail too since [[ADDR]] doesn't include the 0x.
So this comment should say "Windows omits the 0x prefix" instead, since that's the problem.
unsigned long is 32-bit on 64-bit Windows (https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models) so if you want to keep the current approach you want to use uintptr_t and PRIxPTR from stdint.h and inttypes.h respectively:
(Unrelated: Please upload diffs with -U9999)