octave-maintainers
[Top][All Lists]
Advanced

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

Re: gripe() then return pattern


From: John W. Eaton
Subject: Re: gripe() then return pattern
Date: Sun, 27 Dec 2015 19:36:48 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0

On 12/27/2015 11:04 AM, Rik wrote:
12/27/15

jwe,

How do you want to handle patterns in the code such as this from balance.cc?

-- balance.cc:107 --
   if (nn != args(0).columns ())
     {
       gripe_square_matrix_required ("balance");
       return retval;
     }
-- End Code --

The gripe() function in question is just a trivial wrapper around error.

-- gripes.cc:81 --
gripe_square_matrix_required (const char *name)
{
   error ("%s: argument must be a square matrix", name);
}
-- End Code --

Not all of the gripe functions necessarily use error.  Some of them take an
optional third argument (iserror) that determines whether a warning or an
error is issued.  This complicates things, but it still seems like we could
mark at least a subset of the gripe routines with GCC_ATTR_NORETURN.

Yes, please go ahead with this for any that are simple wrappers around error. I thought I had already started doing that, but maybe I just thought about it and didn't follow through with the actual changes.

jwe





reply via email to

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