[Lldb-commits] [PATCH] D71498: Fix ARM32 inferior calls

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 19 07:42:34 PST 2019


jankratochvil added a comment.

In D71498#1785458 <https://reviews.llvm.org/D71498#1785458>, @labath wrote:

> In other places you're replacing a reinterpret_cast<addr_t> with two c casts.


`reinterpret_cast` and a `(c cast)` have the same behavior and as `c cast` is shorter I did prefer it.  But I see `clang-tidy` prefers `reinterpret_cast`:

  warning: C-style casts are discouraged; use static_cast/const_cast/reinterpret_cast [google-readability-casting]



> In these cases the second cast is not really needed, as uintptr_t->addr_t should convert automatically.

Yes.

> Then our rule can be "always convert a pointer to uintptr_t". I don't know if there's a clang-tidy check for that, but it sounds like that could be something which could be checked/enforced there...

Yes, I have now written such clang-tidy extension as D71707 <https://reviews.llvm.org/D71707>.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71498/new/

https://reviews.llvm.org/D71498





More information about the lldb-commits mailing list