high() and low() accept expressions
Original Reporter info from Mantis: kays @KaiBurghardt
-
Reporter name: Kai Burghardt
Original Reporter info from Mantis: kays @KaiBurghardt
- Reporter name: Kai Burghardt
Description:
high() and low() accept expressions, but should only accept ordinal and set data types, or array and set variables
Steps to reproduce:
program dependentRangeDefinition(input, output, stdErr);
type
foo = 0..7;
// Note, this was an accidental programming error of mine:
bar = 0..high(foo * 6);
begin
writeLn(high(bar));
end.
Additional information:
The maximum value an expression may assume is usually of minor interest, since we already know it is the processor’s native type.
Mantis conversion info:
- Mantis ID: 37547
- OS: GNU/Linux
- OS Build: 4.2.0
- Build: 3.0.4+dfsg-11 [2017/12/30]
- Platform: x86_64
- Version: 3.0.4