[clang] [BoundsSafety] WIP: Make 'counted_by' work for pointer fields; late parsing for 'counted_by' on decl attr position (PR #87596)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 12 09:57:05 PDT 2024


================

----------------
rapidsna wrote:

> This should be fine, because count is declared before use—unless I'm getting type attributes confused with field attributes..

`struct size_unknown *__counted_by(count) buf` indicates that `buf` has `sizeof(struct size_unknown) * count` bytes. So the problem is here that the compiler doesn't know what's the actual byte size of `buf` because `sizeof(struct unknown_size)` is not available here.

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


More information about the cfe-commits mailing list