This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: gsl_histogram*_clone should fail silently
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: Achim Gaedke <Achim dot Gaedke at uni-koeln dot de>
- Cc: gsl discussion list <gsl-discuss at sources dot redhat dot com>
- Date: Sun, 20 Jan 2002 21:00:34 +0000 (GMT)
- Subject: Re: gsl_histogram*_clone should fail silently
- References: <3C4AE14C.778AC716@uni-koeln.de>
Achim Gaedke writes:
> If I try to clone an uninitialized histogram, the error handler is
> called twice.
> The first time it is called by
> gsl_histogram*_calloc_range, then it is called again from
> gsl_histogram*_clone, but with an irritating error message "failed
> to allocate space for histogram struct".
> The default error handler did not return, but often it is better
> to handle such an error instead of aborting. With the appended
> patch, there is only one error message: "histogram xrange not in
> increasing order".
Hi,
The general philosophy is to use GSL_ERROR for every error condition.
In some cases this gives multiple error messages but this "is not a
bug, it's a feature" -- more error messages, more information. For
example, two inconsistent error messages immediately suggests an
uninitialized variable, which is the correct interpretation here.
--
Brian