octave-maintainers
[Top][All Lists]
Advanced

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

Re: noreturn for liboctave error handler function pointers


From: Rik
Subject: Re: noreturn for liboctave error handler function pointers
Date: Fri, 1 Jan 2016 21:31:02 -0800

On 12/31/2015 02:40 PM, John W. Eaton wrote:
> Rik:
>
> I agree that tagging the liboctave error handlers with "noreturn" is the
> right thing to do, but in the past they did return (or at least the ones
> we defined in Octave did return).
>
> I suppose it's possible that someone provided their own versions of these
> functions if they were using liboctave in their own program that also
> returned after printing a message.
>
> I guess as things are, liboctave functions can still work properly if the
> function called through the liboctave_error_handler pointer returns
> because that's the way things have always worked up until now.  But
> things will break if we start modifying liboctave in the same way as we
> have modified the libinterp sources.
>
> Should we care?  Maybe just document the change in NEWS?

I imagine the number of people who have overridden the default error
handling routines is vanishingly small.  But we can document it just in
case.  I added this note to the NEWS file:

 ** The default error handlers in liboctave have been updated to use
    exceptions.  After displaying an error message they no longer return
    control to the calling program.  The error handler function can be
    customized through the global variables "current_liboctave_error_handler"
    and "current_liboctave_error_with_id_handler".  If a programmer has
    installed their own custom error handling routines when directly linking
    with liboctave then these must be updated to throw an exception and
    not return to the calling program.

--Rik




reply via email to

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