Re: Exceptions in glib



Owen Taylor <otaylor redhat com> writes: 
> The suggestion to add setjmp/longjmp exceptions has come up a lot.
> The answer we've always arrived at is no.
> 
>  - It's not portable.
>  - It's not safe if you have code in between that isn't expecting it
>  - It's not safe with any language beside C.

You missed a huge one, which is that exceptions are useless unless you
have destructors and functions can automatically free their local
variables as the exception throws through the function. There's no way
to write exception-safe C code.

Havoc




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