Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serious FOR bug in latest dev build s1964
#13
stomachcontents Wrote:Hi guys,

For the simple case of for a=1 to 255, that should totally work as a byte. Both values are in range. Its intuitive, and not unreasonable and certainly possible to implement. If "everyone bumps their head on this" then doesnt it make sense to fix it? Even if the value of a is 0 after the loop thats ok. But bombing out should not be acceptable or something every zx basic coder needs to add to a list of "stuff that doesnt work as u expect" in their heads.

If however the type is too small to fit the range then yeah, thats the coders problem

Just my 2 cents.

Smile
Agree, but if the compilers adds a workaround about it, then the overload of doing so will make the FOR for uByte very suobptimal. I mean, FOR with Ubyte is very fast, because it does not check many things.
Will think more of this. Maybe a compiler flag like --check_overflow for this will work: if the programmer enable it, the code will run slower but will detect this (this is already done for Arrays, BTW)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)