[fpc-devel] IO checks across packages

Pete Cervasio cervasio at airmail.net
Mon Jul 25 15:21:06 CEST 2011


On Monday 25 July 2011 08:07:22 Martin wrote:
> 
> The following demo project enables and disables IO checks to simulate
> the situation.
> 
> program Project1;
> {$mode objfpc}{$H+}
> begin
>    {$I+}
>    writeln('1');
>    {$I-}
>    chdir('c:\IDoNotExist');

You have to check IOResult at this point, since you told the compiler not to 
do it for you.  If you don't, then the error will propagate, as you've seen.  
This behavior has existed forever (since Turbo Pascal 3.0 at the least, maybe 
2.0 had it as well).

Best regards,
Pete C.



More information about the fpc-devel mailing list