История изменений
Исправление LongLiveUbuntu, (текущая версия) :
1 {$RANGECHECKS ON}
2 program ArrayIndex;
3 var arr: array[1 .. 10] of Integer;
4 begin
5 arr[11] := 0;
6 end.
fpc /tmp/test.pas
Free Pascal Compiler version 3.2.2 [2023/08/30] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling /tmp/test.pas
test.pas(5,7) Error: range check error while evaluating constants (11 must be between 1 and 10)
test.pas(7) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
«Компилятор Паскаля не даст вам выстрелить себе в ногу»
Исходная версия LongLiveUbuntu, :
1 {$RANGECHECKS ON}
2 program ArrayIndex;
3 var arr: array[1 .. 10] of Integer;
4 begin
5 arr[11] := 0;
6 end.
fpc /tmp/test.pas
Free Pascal Compiler version 3.2.2 [2023/08/30] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling /tmp/test.pas
test.pas(5,7) Error: range check error while evaluating constants (11 must be between 1 and 10)
test.pas(7) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode