Actually FPC 2.2 does not compile the code:
$ /cygdrive/c/FPC/2.2.0/bin/i386-win32/fpc.exe -Mmacpas crashes.p Free Pascal Compiler version 2.2.0 [2007/09/09] for i386 Copyright (c) 1993-2007 by Florian Klaempfl Target OS: Win32 for i386 Compiling crashes.p crashes.p(17,20) Error: Incompatible type for arg no. 2: Got "local E(SmallInt): Boolean", expected "<procedure variable type of function(SmallInt):Boolean;Regis ter>" crashes.p(24) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: c:\FPC\2.2.0\bin\i386-win32\ppc386.exe returned an error exitcode (normal if you did not specify a source file to be compiled)
2008/4/3, Russell Whitaker russ@ashlandhome.net:
On Thu, 3 Apr 2008, Prof A Olowofoyeku (The African Chief) wrote:
On 3 Apr 2008 at 10:59, Régis Cridlig wrote:
Hello!
This short program compiles without a warning, but crashes at execution. The compiler is FPC 2.2 on the win32 platform.
^^^^^^^
Hmmm, can you run FPC using gpc as the command? Anyway, program compiles and runs using latest gpc on linux platform.
Hope this helps Russ
program Crashes(input,output);
function B(l:integer):boolean; begin B:=true; end;
procedure Q(j:integer;function A(l:integer):boolean);
function E(l:integer):boolean; begin E := false end;
begin if A(j) then Q(200,E); end;
begin Q(100,B); end.
This is the compiler command: $ gpc --classic-pascal -g -Wall crashes.p
Which GPC version are you using?