https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78822
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> --- BTW, yet another option (and I'd say much more readable) is just using build_message_string function, so snprintf (errmsg, err_len, "Rank mismatch in argument '%s' (%i/%i)", s1->name, symbol_rank (s1), symbol_rank (s2)); would be converted to *errmsg = build_message_string ("Rank mismatch in argument '%s' (%i/%i)", s1->name, symbol_rank (s1), symbol_rank (s2)); etc. The caller would need to free it afterwards. Note, the Fortran FE already uses this function as well.