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



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to