[clang-tools-extra] r249399 - Add a new module for the C++ Core Guidelines, and the first checker for those guidelines: cppcoreguidelines-pro-type-reinterpret-cast.

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 23:22:39 PDT 2015


On Wed, Oct 7, 2015 at 7:34 PM Aaron Ballman via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> On Wed, Oct 7, 2015 at 12:05 PM, Joerg Sonnenberger via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
> > On Tue, Oct 06, 2015 at 01:31:01PM -0000, Aaron Ballman via cfe-commits
> wrote:
> >> Log:
> >> Add a new module for the C++ Core Guidelines, and the first checker
> >> for those guidelines: cppcoreguidelines-pro-type-reinterpret-cast.
> >
> > I wonder about the generality of this. Does it really make sense to flag
> > every reinterpret_cast of a void pointer? Such interface contracts
> > normally don't give you an alternative, so it seems a bit silly. This is
> > made worse by the concrete message used...
> >
> > More importantly, can the checker detect all cases where
> > reinterpret_cast is used where a less generic cast applies?
>
> This is a checker specific to the behaviors of the C++ Core
> Guidelines. Personally, I share the same concerns about the viability
> of these kind of checks (specifically, on existing code bases instead
> of on newly-developed code). Especially when there's no guidance as to
> how to correct the code, short of "just don't do that thing despite it
> being well-formed code." However, the concept here is that we want
> checkers to diagnose coding guideline violations as-written, and that
> is why these checkers are being implemented under cppcoreguidelines-*.
>

This is the main reason we need to figure out the documentation story soon
enough... then we can point people at the core guidelines github and
suggest to file bugs :)


>
> ~Aaron
>
> >
> > Joerg
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151008/81251c9f/attachment.html>


More information about the cfe-commits mailing list