[m-rev.] for review: Document that throwing exceptions across the C interface is unsupported.

Julien Fischer jfischer at opturion.com
Tue Sep 20 18:08:44 AEST 2016


On Tue, 20 Sep 2016, Peter Wang wrote:

> doc/reference_manual.texi:
> 	Document that throwing exceptions across the C interface is
> 	unsupported. This was previously only mentioned at the top of
> 	exception.m.
> ---
> doc/reference_manual.texi | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/doc/reference_manual.texi b/doc/reference_manual.texi
> index 4f64956..ba55883 100644
> --- a/doc/reference_manual.texi
> +++ b/doc/reference_manual.texi
> @@ -8125,6 +8125,11 @@ These @samp{type_info} arguments can be obtained using the Mercury
> 
> To use the C declarations produced see @ref{Using pragma foreign_decl for C}.
> 
> +Throwing an exception across the C interface is not supported.
> +That is, if a Mercury procedure that is exported to C using
> + at code{pragma foreign_export} throws an exception which is not caught within

@samp rather than @code.

> +that procedure, then you will get undefined behaviour.

That's fine.  (It's really only true for the low-level C backend, but
since foreign code should ideally be written to work with either C
backend, it's best to assume its true for the high-level backend as
well.)

Julien.


More information about the reviews mailing list