[CLN-list] Overriding read_number_bad_syntax on OS X

Richard B. Kreckel kreckel at ginac.de
Mon May 21 00:08:54 CEST 2007


Bruno Haible wrote:
> I agree with you; the following functions should be realized through hooks
> in the same way:
>    cl_abort
>    cl_error_division_by_0
>    cl_as_error
>    cl_notreached_abort
>    read_number_bad_syntax
>    read_number_eof
>    read_number_junk
>    uninitialized_ring
>    uninitialized_error
>    cl_error_floating_point_nan
>    cl_error_floating_point_overflow
>    cl_error_floating_point_underflow
>    cl_ash_error
>    cl_error_exquo
> possibly even _all_ occurrences of cl_abort.


I'm proceeding with the convertion to throwing exceptions. However, I'm 
feeling unconfident with some of them. Many of the cl_abort calls should 
really be assertions IMO. Is there a point throwing at a code section 
that cannot possibly be reached, except when someone seriously screws up 
CLN? One of the most striking examples is the definition of 
CL_DEFINE_CONVERTER in include/cln/object.h. The conditional there could 
even be written as a compile-time assertion! When I'm finished, I would 
really welcome a short review of the patch.

Cheers
    -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>


More information about the CLN-list mailing list