[clang-tools-extra] [clang-tidy]Add new check bugprone-casting-through-void (PR #69465)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 20 00:18:49 PDT 2023


https://github.com/PiotrZSL approved this pull request.

LGTM.

About `static_cast<void *>(reinterpret_cast<void *>(&i));`:
- I'm working now on a check for redundant casts, it will detect this one, so no need to do it in this check.

You may consider adding support for double and more pointers, but that's not so so necessary as it work only with reinterprert_cast:
```
void double_ptr(int *ptr) {
 reinterpret_cast<int **>(reinterpret_cast<void**>(&ptr));
}
```


https://github.com/llvm/llvm-project/pull/69465


More information about the cfe-commits mailing list