octave-maintainers
[Top][All Lists]
Advanced

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

gripe() then return pattern


From: Rik
Subject: gripe() then return pattern
Date: Sun, 27 Dec 2015 08:04:44 -0800

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.

--Rik




reply via email to

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