[Top][All Lists]

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

Re: [Help-glpk] C++ throw instead of C exit

From: Robbie Morrison
Subject: Re: [Help-glpk] C++ throw instead of C exit
Date: Wed, 20 Jan 2010 18:29:46 +0100
User-agent: Thunderbird (X11/20080306)

Hello all, hello Andrew

> ------------------------------------------------------------
> To:          Robbie Morrison <address@hidden>
> Subject:     Re: [Help-glpk] C++ throw instead of C exit
> Message-ID: <address@hidden>
> From:        Andrew Makhorin <address@hidden>
> Date:        Tue, 19 Jan 2010 00:30:46 +0300
> ------------------------------------------------------------
>> Any thoughts on the proposal?
> Currently in case of fatal error all glpk routines call the
> routine xerror (_glp_lib_xerror), which prints an error
> message and then calls the standard function abort. It is
> assumed that the application program can catch SIGABRT
> signal, if necessary.
> To make the error handling more convenient I will add the
> following api routine:
>    void glp_error_hook(void (*func)(void *info), void *info);
> The parameter func is a user-defined routine, which is
> installed to be called from xerror; if it returns, xerror
> calls abort. The parameter info is a transit pointer (magic
> cookie) passed to func.

This looks fine from my perspective.  System function
'abort' and not 'exit' as I wrote -- it was a while since I
looked at the GLPK source.  I am in no great hurry to use
this feature so it doesn't have to be in the next release.
You may need to expand on the use of 'info' in the
documentation (void* is not often used in C++).

many thanks.  Robbie
Robbie Morrison
Technical University of Berlin, Berlin, Germany
University email (redirected) : address@hidden
Webmail (preferred)           : address@hidden
[from IMAP client]

reply via email to

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