On 10/20/21 22:26, Martin Sebor wrote:
On 10/7/21 4:14 PM, Siddhesh Poyarekar wrote:
Handle either static sizes in function parameters or hints provided by
__attribute__ ((access (...))) to compute sizes for objects.

It's been my hope to eventually teach __builtin_object_size about
attribute access but implementing it in the new built-in might be
preferable.  Glad to see you noticed it and took advantage of it!

Does this include handling "VLA function parameters" as in

   void f (int n, char d[n]);   // (or char d[static n])

I don't see tests for it in this patch but since internally, GCC
describes VLA (and array) function arguments using attribute access
hanndling it should automatically give us VLA (and array) support
as well unless we disable it, either intentionally or by accident.
Either way, I would recommend adding tests for VLA parameters.

Not in this patchset, but I did notice it and put it in my list of things to add on once this makes it in.

Thanks,
Siddhesh

Reply via email to