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.
T
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
__
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
saf
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
finer-graine
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 checker
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 don'
alexfh added a comment.
A high-level comment: the "misc" module is the place for checks that we didn't
find (or create) a better category for. Here it's clear that we need a separate
category, so we need a `CppCoreGuidelinesModule` and the `cppcoreguidelines-`
check prefix. I also suggest using
aaron.ballman added a comment.
In http://reviews.llvm.org/D13313#257506, @alexfh wrote:
> 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
> > en
mgehre updated this revision to Diff 36291.
mgehre added a comment.
Renamed the check to cppcoreguidelines-pro-type-reinterpret-cast
http://reviews.llvm.org/D13313
Files:
clang-tidy/CMakeLists.txt
clang-tidy/Makefile
clang-tidy/cppcoreguidelines/CMakeLists.txt
clang-tidy/cppcoreguidelin
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
clang-tidy/cppcoreguidelines/CMa
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
clang-tidy
11 matches
Mail list logo