Mode iso

FPC’s compatibility mode {$mode ISO} intends to comply with the requirements of level 0 and 1 of the ISO/IEC standard 7185. It became available in version 2.6.0. The International Organization for Standardization standard 7185 is also known as Standard “Unextended” Pascal.

Notable differences

edit

This list highlights differences to the standard {$mode FPC} compiler compatibility mode.

{$mode ISO}
program routineParameter(output);

procedure fancyPrint(function f: integer);
begin
    writeLn('❧ ', f:1, ' ☙')
end;

function getRandom: integer;
begin
    { chosen by fair dice roll: guaranteed to be random }
    getRandom := 4
end;

begin
    fancyPrint(getRandom);
end.

Status

edit

Notes

edit

It is quite possible that a different compiler rejects the same source code on grounds of non-compliance. Unlike the GNU Pascal Compiler there is no way to disable such “extensions”.