octave-maintainers
[Top][All Lists]
Advanced

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

Re: warnings shut off in ov.cc?


From: John W. Eaton
Subject: Re: warnings shut off in ov.cc?
Date: Tue, 15 Oct 2019 17:26:09 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 10/15/19 5:13 PM, Rik wrote:

What about just not discarding warning messages?  I commented out this line

//    es.discard_warning_messages (true);

and then everything works as expected (no duplicate warning messages either).

That's OK for the command line where you are parsing and executing the code once. But in a function, it means you'll get the warning when the function is parsed and not when it is executed.

Just to be sure, I added more printf test code and even though the warning
is issued, the path through the constant logic is still taken.  Maybe the
unwind_protect frame is only required to capture errors, but warnings are
fine since they return to the original code and it keeps executing?

Since my recent changes to error handling, error messages are stored in the execution_exception object so they are not printed until the exception is caught and processed, so we have the option of ignoring them and detecting that an error has occurred. That happens with the try/catch block and doesn't rely on the unwind_protect object.

Warnings are printed immediately. We still have a way to discard warning messages globally, but I'm not sure that's a good idea either.

See the thread


https://lists.gnu.org/archive/html/octave-maintainers/2019-10/msg00009.html

jwe



reply via email to

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