https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78822

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Comment on attachment 40346
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40346
draft patch

Dunno, you can perhaps try it (put a breakpoint somewhere before you construct
the std::string, when you reach it, put a breakpoint on malloc and when you
reach it, change the return value from it to NULL and see what happens.

Also, including STL headers after gcc headers is highly problematic (mainly
because of all the poisoning in system.h).

E.g. the
+      ss << "INTENT mismatch in argument '" << s1->name << "'";
+      errmsg = ss.str();
stuff could be easily written as:
       errmsg = concat ("INTENT mismatch in argument '", s1->name, "'", NULL);
and just free it after use, but for the %i you'd have to write some helper
routines (e.g. if you ever use at most two %i, then you could have 2 routines
which just snprintf %i into a smallish static buffer (3 * sizeof (int) should
be good enough) and return address of that buffer, or one routine that has
extra argument which says which of the two buffers you want).

Reply via email to