that exact example is given in the document and presented as 1 of 2 possible solutions. I believe, the critique in the parent comment was unwarranted, but I thought I maybe missed something.
that's latest GCC, at -O3
But yes, sadly I think it's still generally advisable to avoid returning large structs by value.
Note that this has nothing to do with RVO; as I understand it, RVO is about eliding copy constructors, not actual memory copies, and c has no copy constructors and so gets 'RVO' in all cases.
For the use cases that are too expensive to use functions, macros can be used instead.
However that is only if C++ cannot be used at all, otherwise don't bother.
T get_t(int how, char **error);
int get_val(T *v);
One could rewrite these as struct get_t_res {T; char *};
struct get_t_res get_t(int);
struct get_val_res {int; T};
struct get_val_res get_val();
But what do you think of it?