[fpc-devel] IO checks across packages

Martin fpc at mfriebe.de
Mon Jul 25 15:07:22 CEST 2011


I found a problem with IO checks, if a project is compiled using 
packages, that have been compiled with other settings.
I wonder, if this would be considered a bug:

If some packages are compiled with and some without IO checking. An IO 
error happens in a package that is compiled without IO checking, as 
expected no error is risen here. But the error is stored, and an 
unrelated statement which has IO checks will fail later.

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');
   {$I+}
   writeln('2');  // error for chdir is risen here
   readln;
end.




More information about the fpc-devel mailing list