Don't get I/O error as expected by Array of [Enumrange]
Original Reporter info from Mantis: Michl @michl1
-
Reporter name: Michl
Original Reporter info from Mantis: Michl @michl1
- Reporter name: Michl
Description:
If I compile a program with -CirotR I expect a exception, but it doesn't come.
Steps to reproduce:
program project1;
type
TSomeEnums = (One, Two, Three);
resourcestring
SOne = 'One ape';
STwo = 'Two apes';
SThree = 'Three apes';
const
SSomeEnumStrings: array [Low(TSomeEnums)..High(TSomeEnums)] of string = (
SOne, STwo, SThree);
var
i: Integer;
SE: TSomeEnums;
begin
for i := 0 to 4 do begin
SE := TSomeEnums(i);
WriteLn(SSomeEnumStrings[SE]);
end;
end.
The result is:
One ape
Two apes
Three apes
PROJECT1
Additional information:
Compile mode: -MObjFPC -Scaghi -CirotR -O1 -g -gl -l -vewnhibq -Filib\i386-win32 -Fu. -FUlib\i386-win32
If you simple write the enums, a runerror 107 comes, how it should be.
...
begin
for i := 0 to 4 do begin
SE := TSomeEnums(i);
WriteLn(SE);
end;
end.
Mantis conversion info:
- Mantis ID: 29147
- OS: 7
- OS Build: 32bit
- Build: 32606
- Platform: Windows
- Version: 3.1.1