xazax.hun added a subscriber: xazax.hun.
xazax.hun added a comment.
If you check AvoidCStyleCastsCheck.cpp, it also suggest what kind of cast
should you use to replace a C style cast. Probably, in some cases, the
developers might be able to change the reinterpret_cast to something more type
aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added reviewers: aaron.ballman, alexfh.
aaron.ballman added a comment.
As a slightly more broad question: I think we should have a user-customizable
way to categorize these checks so that you can enable/disable them with
alexfh added a comment.
In http://reviews.llvm.org/D13313#256982, @vsk wrote:
> The patch lgtm. Has there been a discussion on cfe-dev about adopting these
> guidelines?
>
> I count well over 500 uses of reinterpret_cast in llvm+clang, so we might not
> all be on the same page on this.
I
alexfh added a comment.
In http://reviews.llvm.org/D13313#257476, @aaron.ballman wrote:
> As a slightly more broad question: I think we should have a user-customizable
> way to categorize these checks so that you can enable/disable them with
> finer-grained control. Some of the existing
mgehre updated this revision to Diff 36296.
mgehre added a comment.
Read 'Check' suffix on ProTypeReinterpretCastCheck
http://reviews.llvm.org/D13313
Files:
clang-tidy/CMakeLists.txt
clang-tidy/Makefile
clang-tidy/add_new_check.py
clang-tidy/cppcoreguidelines/CMakeLists.txt
mgehre updated this revision to Diff 36294.
mgehre added a comment.
Fix add_new_check.py for capitalization of CppCoreGuidelinesTidyModule.cpp
http://reviews.llvm.org/D13313
Files:
clang-tidy/CMakeLists.txt
clang-tidy/Makefile
clang-tidy/add_new_check.py
vsk added a subscriber: vsk.
vsk added a comment.
The patch lgtm. Has there been a discussion on cfe-dev about adopting these
guidelines?
I count well over 500 uses of reinterpret_cast in llvm+clang, so we might not
all be on the same page on this.
http://reviews.llvm.org/D13313
mgehre created this revision.
mgehre added a subscriber: cfe-commits.
This check flags all uses of reinterpret_cast in C++ code.
Use of these casts can violate type safety and cause the program to
access a variable that is actually of type X to be accessed as if it
were of an unrelated type Z.