octave-maintainers
[Top][All Lists]
Advanced

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

Re: message ids for warnings and errors


From: John W. Eaton
Subject: Re: message ids for warnings and errors
Date: Wed, 7 Dec 2005 01:45:12 -0500

On  6-Dec-2005, Søren Hauberg wrote:

| Matlab is to "smart":

Yup.  I guess you are supposed to always save the previous warning
state if you want to return to it.  But is it nice or not that
"warning on all" leaves a few warnings disabled?

In any case, I've just checked in some changes to Octave's warning
function to allow message-ids.  You can also use

  warning error ID

to turn warnings into errors.  I think this is also compatible
behavior.

To distinguish message-ids from formats when two or more arguments are
passed to the warning function, we check the first argument to warning
to see if it contains "%".  If so, we assume it is a format, otherwise
it is a message-id.  It's a bit of a kluge, but I'm not sure there is
anything better to do.

No calls to warning actually use message-ids yet, but the next step
should be to eliminate the need for the warn_* built-in variables.
I'd appreciate any help with that.  It should be relatively easy.

Thanks,

jwe



reply via email to

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