Sorry.
So, I'm on Linux Mint 16, Cinnamon. Well, it's FPC 2.6.2 , so maybe that's the reason...
Anyway, I found something with grep. It's file /rtl/inc/sstrings.inc, lines 536-543. They read:
procedure fpc_shortstr_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out s:shortstring);[public,alias:'FPC_SHORTSTR_ENUM'];compilerproc;
var
res: longint;
begin
res:=fpc_shortstr_enum_intern(ordinal,len,typinfo,ord2strindex,s);
if (res<>0) then
runerror(107);
end;
Edit: @marcov, it seems it is how you say. But if so, why {$I-} prevents the program from crashing?
Well, the program crashes because it can't handle the enum correctly. But {$I-} should prevent it from crashing only if it couldn't read the data correctly. But no errors araised there, since IOResult continues to be set to 0!
Edit2: Ahh, I get it.
http://pastebin.com/DLxVpyfs Now the program prints out nicely 107. The error araises on an attempt to write g, not to read the file . Anyway, IOResult code 107 again is not documented:
http://www.freepascal.org/docs-html/rtl/system/ioresult.htmlSeems I'll have to compile & run the program on an up-to-date fpc version.