Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-07

How to increase the range ckeck limit?

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

Reply by email

Michael Van Canneyt
to silvioprog
silvioprog wrote 16 lines
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.

Reply by email

silvioprog
to DaWorm
DaWorm wrote 8 lines
> 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

Reply by email