How to increase the range ckeck limit?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to increase the range ckeck limit?

silvioprog
Hello,

Is there any compiler switch to increase the range limit check for operations like this?:

{$R-}

var
  r: SmallInt = 256;
  i : SmallInt;
begin
  i := 10;
  if i in [0..r] then
    WriteLn('OK')
  else
    WriteLn('Fail');
end;

Thank you!

--
Silvio Clécio
My public projects - github.com/silvioprog

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: How to increase the range ckeck limit?

Michael Van Canneyt


On Sat, 4 Jul 2015, silvioprog wrote:

> Hello,
>
> Is there any compiler switch to increase the range limit check for operations like this?:
>
> {$R-}
>
> var
>   r: SmallInt = 256;
>   i : SmallInt;
> begin
>   i := 10;
>   if i in [0..r] then
>     WriteLn('OK')
>   else
>     WriteLn('Fail');
> end;
What do you mean,  your question is not clear ?

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: How to increase the range ckeck limit?

DaWorm


> What do you mean,  your question is not clear ?

Since r is set to 256, the [0..r] probably doesn't work, even with the range check turned off.  So I assume he's really asking for larger sets.

Jeff


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: How to increase the range ckeck limit?

silvioprog
On Sun, Jul 5, 2015 at 11:27 AM, DaWorm <[hidden email]> wrote:

> What do you mean,  your question is not clear ?

Since r is set to 256, the [0..r] probably doesn't work, even with the range check turned off.  So I assume he's really asking for larger sets.

Jeff

Exactly. =)

And the same behaviour occurs on Delphi too.

Thank you!

--
Silvio Clécio
My public projects - github.com/silvioprog

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal