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

Bill Wendling <isanbard at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |isanbard at gmail dot com

--- Comment #10 from Bill Wendling <isanbard at gmail dot com> ---
(In reply to Jakub Jelinek from comment #2)
> So, what would be the prototype of the builtin?
> Would it be type-generic for both arguments, i.e. effectively
> void __builtin_set_counted_by (...);
> which would just verify that 2 arguments are passed, the first one is some
> flexible array member with counted_by argument and the second argument has
> some type implicitly convertible to the type of the counted_by member?

The Clang implementation will probably have a prototype of something like:

  void __builtin_set_counted_by(void *, size_t)

The 'void *' could be questionable, but I'm not sure how else to specify it (of
course the compiler will do its magic internally to verify that it's a pointer
to a FAM and has the 'counted_by' attribute, etc.). If we use 'void *', is it
considered an error for the first parameter to NOT be a FAM? Or does the
builtin silently become a no-op?

Reply via email to