lebedev.ri added a comment.

In D91055#2382112 <https://reviews.llvm.org/D91055#2382112>, @nlopes wrote:

> Nice!

Why thank you.

> BTW, another popular idiom is to store data in the last few bits of the 
> pointer (e.g., LLVM's own PointerIntPair). I guess that one can also be 
> implement by casting the ptr to char* and doing operations over that.

Yep, there is a number of such patterns.
My basic idea behind this patch is that it is very much non-obvious whether

1. such a cast was actually intended to be there
2. the provenance obscurement is intentional

so let's just diagnose everything, and the user can either silence it, or 
rewrite it without the cast.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91055/new/

https://reviews.llvm.org/D91055

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to