[Oberon] Negative integer literals in Oberon
joerg.straube at iaeth.ch
Sat May 2 22:07:28 CEST 2020
In my point of view a compiler should be consistent.
If he inserts code for runtime checks, I'm happy he checks also at compile time.
If he doesn't generate code for runtime checks, there is no point to check at compile time as I could write
i := 300; b := i;
Typically, the code generated for b := i; is "store byte i -> b", no runtime check.
Am 02.05.20, 18:55 schrieb "Oberon im Auftrag von August Karlstrom" <oberon-bounces at lists.inf.ethz.ch im Auftrag von fusionfile at gmail.com>:
On 2020-05-02 13:43, Joerg wrote:
> If the compiler does not generate a runtime range check for b := i,
> then b := 300; should not generate a compile time error neither.
Why not? For a byte variable b, the statement b := 300 is invalid
according to the language report, so I think the compiler should reject it.
Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
More information about the Oberon