[PATCH] D156188: [-Wunsafe-buffer-usage] Refactor and improve for parameter fix-its

Ziqing Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 9 15:57:14 PDT 2023


ziqingluo-90 added a comment.

> Btw, how does this work with `int **`? Given that the pointee type `int *` isn't a simple identifier.

It does not require the pointee type to be a simple identifier.   The (source range of) pointee type is obtained by analyzing the `TypeLoc` of a variable declaration.

The limitation involving "identifiers" is that we require the pointee type to be completely on the left of the variable identifier in a variable declaration.  As the analysis is based on source locations, 
finding the pointee type source range in cases like `int a[][10]` or  `int (*a)[10]` is non-trivial.


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

https://reviews.llvm.org/D156188



More information about the cfe-commits mailing list