octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57396] [octave forge] (ocs) Compilation failu


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #57396] [octave forge] (ocs) Compilation failure
Date: Thu, 12 Dec 2019 10:43:54 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0

Follow-up Comment #1, bug #57396 (project octave):

The easiest fix would probably be to provide a primitive format string:

warning ("%s", (string("Mshichmanhodgesmosfet: unknown parameter").append
(parameternames[niter])).c_str ());


On an unrelated note: You might run into issues with the lifetime of the
temporary string. I.e. the c_str pointer might be dereferenced by "warning"
after the temporary string was already deleted. It's probably safer to assign
it to a variable with well-defined scope:

string warn_string = string ("Mshichmanhodgesmosfet: unknown
parameter").append (parameternames[niter]);
warning ("%s", warn_string.c_str ());


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57396>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]