https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016
--- Comment #13 from Siddhesh Poyarekar <siddhesh at gcc dot gnu.org> --- (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? > argument count_exp must be an expression that can be converted to the type > of the flexible array member. Shouldn't count_exp be __SIZE_TYPE__? Why should it be convertible to the type of the FAM?