This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/78822] [cleanup] replace static char buffers by std:string


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]