https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016

--- Comment #51 from Alejandro Colomar <alx at kernel dot org> ---
(In reply to Siddhesh Poyarekar from comment #13)
> (In reply to qinzhao from comment #11)
> > After the discussion with Kees on the major usage of this new builtin, I
> > think that the above Category A might be a natural fit for this new
> > __builtin_set_counted_by. i.e, a C language extension (RID_BUILTIN). 
> > 
> > We could define the new __builtin_set_counted_by as
> > 
> > void __builtin_set_counted_by (FAM_exp, count_exp)
> > 
> > The FAM_exp expression must be a flexible array member reference. The second
> 
> Does it have to be a FAM?  What is the problem if this is used on, e.g. an
> arbitrary pointer?

I would make it a compile-time error.  Why would we want to allow a non-FAM
there?  (Unless the [[gnu::counted_by()]] attribute makes sense elsewhere.)

Reply via email to