[PATCH] D91055: [clang-tidy] Introduce misc No Integer To Pointer Cast check

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 06:30:51 PST 2020


aaron.ballman added subscribers: jeroen.dobbelaere, jdoerfert, hfinkel.
aaron.ballman added a comment.

In D91055#2382356 <https://reviews.llvm.org/D91055#2382356>, @lebedev.ri wrote:

> CC'ing @rsmith regarding the suggestion/question of also having a clang diagnostic for this.

I'm not Richard, but I have some thoughts just the same. :-) The C committee is currently exploring questions of pointer provenance that may have impact in this area. You can see the proposed text for a TS on pointer provenance here: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2577.pdf The paper goes into a lot of detail about various provenance choices and how those choices impact existing code, implementations, optimization opportunities, etc. and my concern with adding a provenance check to the Clang frontend at this time is that LLVM may want to implement changes from that TS which may cause unfortunate code churn for users who enable the warning in Clang. I think keeping this check in clang-tidy gives us good utility for catching bugs today, but also gives us a safer place to react to changes in the C standard. At some point, I expect the question of how to track provenance to settle down within the committee and our implementation, and that would be a good time to consider lifting the analysis into Clang. CCing @nlopes @hfinkel @jeroen.dobbelaere and @jdoerfert to raise awareness on the provenance TS in case it wasn't yet on their radar.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91055



More information about the llvm-commits mailing list