This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gsl_histogram*_clone should fail silently


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]