Sign in Join

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

Mailing lists / fpc-devel / 2002-10

Re: bug report 2181

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Peter Vreman
to Rimgaudas Laucius: About bug report 2181: why 9985 in [1, 2]? M := 9985; if M in [1, 2] then WriteLn…
Show quoted text 9 lines
About bug report 2181: why 9985 in [1, 2]? M := 9985; if M in [1, 2] then WriteLn ('Error!'); I tryed it with fpc 1.1. There is consistent pattern: for m:= 1 to n do if (m*256+x) in [x] then writeln(m);

This is also how TP/Delphi handles it. We also got a bug report in the past that asked for this behaviour.
Compile with -Cr to get an error.

Reply by email

Rimgaudas Laucius
About bug report 2181: why 9985 in [1, 2]?
M := 9985;
  if M in [1, 2] then WriteLn ('Error!');
I tryed it with fpc 1.1. There is consistent pattern:
for m:= 1 to n do
  if (m*256+x) in [x] then
    writeln(m);

Reply by email

Rimgaudas Laucius
to Peter Vreman: This is also how TP/Delphi handles it. We also got a bug report in the past that asked…
Show quoted text 13 lines
> > About bug report 2181: why 9985 in [1, 2]? > M := 9985; > if M in [1, 2] then WriteLn ('Error!'); > > I tryed it with fpc 1.1. There is consistent pattern: > for m:= 1 to n do > if (m*256+x) in [x] then > writeln(m); This is also how TP/Delphi handles it. We also got a bug report in the past that asked for this behaviour. Compile with -Cr to get an error.

I know sets can be only 4 byte width. But i trayed it with Delphi 6 previuos to Fpc and this misguide me. Because Delphi program works without runtime error (compiled with range checking on) and does not print anything to screen.

Reply by email