octave-maintainers
[Top][All Lists]
Advanced

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

Re: Best approach to error() code in __glpk__.cc?


From: John W. Eaton
Subject: Re: Best approach to error() code in __glpk__.cc?
Date: Mon, 21 Dec 2015 11:52:25 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0

On 12/21/2015 11:40 AM, Rik wrote:
All,

Is anyone familiar enough with the __glpk__ code to say what should happen
in the following case?

-- __glpk__.cc:175 --
if (save_pb)
   {
     static char tmp[] = "outpb.lp";
     if (glp_write_lp (lp, NULL, tmp) != 0)
       {
         // FIXME: This doesn't work anymore now that error does not return.
         //        Should longjmp just be deleted?
         error ("__glpk__: unable to write problem");
         longjmp (mark, -1);
       }
   }
-- End Code --

I added the FIXME note.  It seems like we could either:

1) Delete longjmp because it is no longer reachable
2) Downgrade the error() to warning() and preserve the call to longjmp
3) ??? Alternative solution ???

I'm not sure what the purpose was, but it doesn't look right to me now. If it was for cleanup, then it should probably be using unwind_protect in some way. I'll take a look at it.

jwe





reply via email to

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