Re: [fpc-pascal] Error? No range checks in mode delphi?

2019-06-03 Thread Sven Barth via fpc-pascal
Anthony Walter  schrieb am Di., 4. Juni 2019, 03:27:

> That fixes it, but then the question is why does {$mode delphi} differ
> from {$mode objfpc}?
>

Mode ObjFPC is stricter in some cases. While mode Delphi cares for Delphi
compatibility.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Error? No range checks in mode delphi?

2019-06-03 Thread Anthony Walter
That fixes it, but then the question is why does {$mode delphi} differ from
{$mode objfpc}?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Error? No range checks in mode delphi?

2019-06-03 Thread Marcos Douglas B. Santos
On Mon, Jun 3, 2019 at 4:46 PM Anthony Walter  wrote:
>
> Is the following a bug in the compiler or a feature? Is would seem using 
> {$mode delphi} allows code which clearly violates range bound to compile 
> without error.
>
> 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.

Debugging option -> check Range (-Cr)

regards,
Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Error? No range checks in mode delphi?

2019-06-03 Thread Anthony Walter
Is the following a bug in the compiler or a feature? Is would seem using
{$mode delphi} allows code which clearly violates range bound to compile
without error.

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.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal