You are not logged in.
Pages: 1
Hi,
I am trying to use mORMoti18n the first time.
Versions:
FPC/Lazarus fixes branch -up to date
mORMot 1.18 -up to date
mORMoti18n.pas(324,15) Error: range check error while evaluating constants (255 must be between 0 and 59)
const
/// value stored into a TLanguages enumerate to mark no language selected yet
LANGUAGE_NONE = TLanguages(255);
Offline
I have all units in the project with {$I Synopse.inc}
Checked Synopse.inc, it is the same as in the repository
(********************** Shared Conditionals **********************)
{$ifdef PUREPASCAL}
{$define NODELPHIASM}
{$define FPC_OR_PUREPASCAL}
{$else}
{$endif PUREPASCAL}
{$H+} // we use long strings
{$R-} // disable Range checking in our code
There are no range checking defines in project options or in the source files.
Is there something else I can check?
Last edited by Leslie7 (2022-04-01 07:02:07)
Offline
I have tried it with a freshly created application in Lazarus and the problem is the same.
Is it possible that the compiler's behavior has changed?
Last edited by Leslie7 (2022-04-01 08:05:38)
Offline
Sounds like the FPC trunk did change its behavior about range and type checking: it is as if they added some new checks at runtime.
Do have anyone any information about that?
IMHO this is unacceptable because it would break a lot of existing code.
It also break what Delphi and FPC did for decades... weird...
I suspect they will go back and disable this "feature".
Don't use FPC trunk until it is stabilized.
Online
It may be linked to https://wiki.freepascal.org/User_Change … elphi_mode
Which is wrong in its statement: Delphi has no trouble with LANGUAGE_NONE = TLanguages(255), from Delphi 1 to latest Delphi 11.1.
Where to report the problem?
Online
This is most likely the cause.
I will do some digging.
AFAIK we are using the same "fixes" branch .
At which commit is yours?
Last edited by Leslie7 (2022-04-01 09:03:20)
Offline
Where to report the problem?
fpc-devel mailing list is very active and probably will get noticed sooner then creating a git issue.
https://www.freepascal.org/maillist.html
Offline
I have posted on https://forum.lazarus.freepascal.org/in … ic=58942.0
Online
https://gitlab.com/freepascal.org/fpc/s … 372da876e6
https://gitlab.com/freepascal.org/fpc/s … 372da876e6
This was amazingly fast fix during a weekend from the FPC devs!
I have applied the changes to the fixes branch locally and the range checking errors are gone, but unfortunately there other compiler errors like this with ResStringRec.Identifier:
mORMoti18n.pas(901,19) Error: Illegal qualifier
function LoadResString(ResStringRec: PResStringRec): string;
var Buffer: array [0..4095] of Char; // char = use the generic string type
i: integer;
begin
if ResStringRec=nil then begin
result := '';
Exit;
end;
if ResStringRec.Identifier[<64*1024 then begin
Offline
Ok, got it. The easily predictable question is: any plans?
Offline
Excellent, this is a really important part of the library.
Offline
Pages: 1