On Fri, 27 Sep 2024, Qing Zhao wrote: > + if (TREE_CODE (TREE_TYPE (ref)) != ARRAY_TYPE) > + { > + error_at (loc, "the argument must be an array" > + "%<__builtin_counted_by_ref%>");
This diagnostic is missing a space before %<__builtin_counted_by_ref%>. It's also ungrammatical; something better would be "the argument to %<__builtin_counted_by_ref%> must be an array" or similar. > +@defbuiltin{@var{type} __builtin_counted_by_ref (@var{ptr})} > +The built-in function @code{__builtin_counted_by_ref} checks whether the > array > +object pointed by the pointer @var{ptr} has another object associated with it > +that represents the number of elements in the array object through the > +@code{counted_by} attribute (i.e. the counted-by object). If so, returns a > +pointer to the corresponding counted-by object. > +If such counted-by object does not exist, returns a NULL pointer. This should be "null pointer" (describing the value returned rather than referring to the macro NULL which would be @code{NULL} in the manual). > +The argument @var{ptr} must be a pointer to an array. > +The @var{type} of the returned value must be a pointer type pointing to the "is a pointer type" rather than "must be"; this is describing the type returned by a built-in function, not a requirement on a type passed by the user. > +corresponding type of the counted-by object or a VOID pointer type in case > +of a NULL pointer being returned. "null pointer", and "void" not "VOID". > +returns a void NULL pointer. Likewise, "null pointer", maybe in the form "null pointer to @code{void}". -- Joseph S. Myers josmy...@redhat.com