The following gives the error "reference expected, value given", which is very confusing (it took me ages to spot the problem as being a mismatched procedure type in one of the parameters.
I realize error messages are often very difficult, and it looks like in this case, the error was actually changed from "type mismatch in argument 1 of" (see Subject: Protected Var parameter bug in the list archives). You can mark this as a low priority, but it took me quite a while to figure out what was wrong. Peter.
gpc -c peterS.pas peterS.pas: In main program: peterS.pas:25: error: reference expected, value given
// This program is meant to fail to compile, but would hopefully display a better error message. program PeterS;
type SInt16 = Integer attribute( size = 16 );
function InitIcons( var msg: SInt16 ): Integer; begin return 0; end;
type StartupInitProc = function( var msg: Integer ): Integer;
procedure SetStartup( init: StartupInitProc ); begin end;
begin SetStartup( InitIcons ); end.