[clang] [Wunsafe-buffer-usage] Address some false positives in handling array indices that are decidably correct (PR #117370)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 20 19:29:04 PST 2024


mxms0 wrote:

> I think there's a policy question here of how much trust we want to put into the type system. Clearly, we've already put some trust into it to reduce false positives, but we could decide to trust any old constant array type bounds, and that would be a good code simplification.

My view is that we should trust it (the type system) until we have evidence that it's more of a problem. Developers doing really hacky bad things I expect to be a lot less common than developers doing bad things by accident (i.e. a classic index out of bounds)

https://github.com/llvm/llvm-project/pull/117370


More information about the cfe-commits mailing list