[fpc-devel] Patch: Exception handling without SysUtils

Florian Klaempfl F.Klaempfl at gmx.de
Thu Jul 7 20:53:48 CEST 2005

Yury Sidorov wrote:

> From: "Florian Klaempfl" <florian at freepascal.org>
>>> I found that try...except and try...finally do not work if SysUtils 
>>> unit is
>>> not used (exception handling code is not called).
>>> The following patch fixes this issue.
>> Not using sysutils means that you don't want exceptions. If you want 
>> to have run
>> time errors converted into exceptions use sysutils. The patch has another
>> probably undesired side effect: imaging someone installed an own 
>> errorproc to
>> release resources (memory etc.) if he did so, he won't get that 
>> exception.
> I think try/finally/except should work without SysUtils. It works in 
> Delphi. For example KOL library does not use SysUtils, but programmer 
> can use try/finally/except to write crash-proof code.
> In my final patch the described side effect with ErrorProc is solved. 
> The exception will be raised after ErrorProc exit. Also stack dump on 
> unhandled exception is fixed.

Looks good.

> So I can not see any reason to do not include this patch...

Applied, thx.

More information about the fpc-devel mailing list