Enable range check for Delphi-mode

Original Reporter info from Mantis: rd0x
  • Reporter name:

Description:

From Anthony Walter on mailing list: https://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg51001.html

In Delphi Rio it triggers:
[dcc32 Error] Project1.dpr(16): E1012 Constant expression violates subrange bounds

So I think its a good idea to enable range checking by default for Delphi-mode for better compiler compatibility

Steps to reproduce:

program Project1;

{$mode delphi}

type
  TSuit = (suHeart, suDiamond, suClub, suSpade);
  TRedSuit = suHeart..suDiamond;

var
  Suit: TRedSuit;
begin
  // This should generate an error, but {$mode delphi} allows it
  Suit := suClub;
end.

Mantis conversion info: