There are a few places in LLDB where we do a reinterpret_cast for conversions that we could also do with static_cast. This patch moves all this code to static_cast.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/tools/debugserver/source/MacOSX/MachProcess.mm | ||
---|---|---|
1745 | static_cast<uint64_t>(addr) and static_cast<uint64_t>(length) | |
1777 | static_cast<uint64_t>(addr) and static_cast<uint64_t>(length) You can use -Wold-style-cast to warm on C-style casts. | |
2306 | static_cast<uint64_t>(buf_size) | |
2466 | static_cast<uint64_t>(buf_size) |
This is a great change! Moving to stricter casts clarifies intent and reduces the chance that later changes can introduce bugs accidentally.
lldb/tools/debugserver/source/MacOSX/MachProcess.mm | ||
---|---|---|
1745 | Uhm, I agree with removing those C casts, but I don't want to start removing a few random C casts in a patch that is about removing reinterpret_cast (and you anyway already opened a review for removing C casts). I'll can make a separate patch for all the C casts (or we could fix those APIs to not be unsafe variadic functions which would remove the need to cast everything). |
static_cast<uint64_t>(addr) and static_cast<uint64_t>(length)