Re: [fpc-devel] bug 3626
>> im not going to argue whether this is right or wrong but in delphi at >> least >> $R only affects run time range checking. In delphi that code will give >> an >> error (constant expression violates subrange bounds) even with range >> checking off. I think this is a special case with for-loops. Delphi also doesn't allow the loop-variable to be int64. I'll add a check to test for the 32bit range. Ofcourse this is a 32bit target only issue. The code is legal on 64bit targets. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bug 3626
can agree. peter green wrote: im not going to argue whether this is right or wrong but in delphi at least $R only affects run time range checking. In delphi that code will give an error (constant expression violates subrange bounds) even with range checking off. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bug 3626
[EMAIL PROTECTED] wrote: int64 <> integer ??? The compiler reports a range check error depending on $R as warning or error. So where is the problem? What do you expect to happen? If I got it right the question is about a comparison statement of two integer numbers. IMHO from the logocal view this should not produce a compiler error or a runtime error as you can compare any two numbers even if the underlying data types are not the same. Logically it's OK to check if 600 <> 3. So the production of range check errors (runtime or compiletime) is IMHO logically wrong. Warnings are OK as it may be an unintentional error but if the compiler compiles int64 <> integer as int64temp := integer; int64 <> int64temp it would be just the intended behaviuor in any 'normal' situation I can imagine. Have a nice day, -- Konstantin Münning ,,, ---/'^'\ www.muenning.com ( o o ) [EMAIL PROTECTED] --oOOO--(_)--OOOo--- Beware of Programmers who carry screwdrivers. -- Leonard Brandwein (-O-) The man who follows the crowd will usually get no further than the crowd. The man who walks alone is likely to find himself in places no one has ever been. -- Alan Ashley-Pitt ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
RE: [fpc-devel] bug 3626
> [EMAIL PROTECTED] wrote: > > int64 <> integer ??? > > The compiler reports a range check error depending on $R as > warning or error. So > where is the problem? What do you expect to happen? im not going to argue whether this is right or wrong but in delphi at least $R only affects run time range checking. In delphi that code will give an error (constant expression violates subrange bounds) even with range checking off. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bug 3626
I expect a "out of bounds error" messeage. Independent from $R. Florian Klaempfl wrote: [EMAIL PROTECTED] wrote: int64 <> integer ??? The compiler reports a range check error depending on $R as warning or error. So where is the problem? What do you expect to happen? Vincent Snijders wrote: [EMAIL PROTECTED] wrote: bug 3626 is marked as "Not a bug". This is wrong! The comment is also wrong! Why? 9 is a valid int64... Vincent. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bug 3626
On 2 feb 2005, at 16:43, [EMAIL PROTECTED] wrote: int64 <> integer ??? They are assignment-compatible. If the value doesn't fit in the range of the destination type, you get either a warning (if range checking is off) or an error (if range checking is on). Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bug 3626
[EMAIL PROTECTED] wrote: int64 <> integer ??? The compiler reports a range check error depending on $R as warning or error. So where is the problem? What do you expect to happen? Vincent Snijders wrote: [EMAIL PROTECTED] wrote: bug 3626 is marked as "Not a bug". This is wrong! The comment is also wrong! Why? 9 is a valid int64... Vincent. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bug 3626
int64 <> integer ??? Vincent Snijders wrote: [EMAIL PROTECTED] wrote: bug 3626 is marked as "Not a bug". This is wrong! The comment is also wrong! Why? 9 is a valid int64... Vincent. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] bug 3626
[EMAIL PROTECTED] wrote: bug 3626 is marked as "Not a bug". This is wrong! The comment is also wrong! Why? 9 is a valid int64... Vincent. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] bug 3626
bug 3626 is marked as "Not a bug". This is wrong! The comment is also wrong! - BR. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel