https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92867
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- GCC already has various attributes that take argument positions, e.g. the nonnull, alloc_size, format, format_arg, so we should follow what is used for those for this argument. E.g. for format_arg we document: The parameter STRING-INDEX specifies which argument is the format string argument (starting from one). Since non-static C++ methods have an implicit 'this' argument, the arguments of such methods should be counted from two. and similarly for format, for nonnull and alloc_size we don't, so it might be worth checking what we actually do. There is also the case of an artificial argument holding address to the return slot, I think that is what comes up only in RTL and would hope RTL handles it right, but it is worth checking that too.