Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Gábor Horváth via cfe-commits
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

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Aaron Ballman via cfe-commits
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

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Alexander Kornienko via cfe-commits
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

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Alexander Kornienko via cfe-commits
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

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Matthias Gehre via cfe-commits
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

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Matthias Gehre via cfe-commits
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

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-09-30 Thread Vedant Kumar via cfe-commits
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

[PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-09-30 Thread Matthias Gehre via cfe-commits
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.