[Oberon] Negative integer literals in Oberon
Jörg
joerg.straube at iaeth.ch
Sat May 2 22:07:28 CEST 2020
August
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.
br
Jörg
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.
-- August
--
Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
https://lists.inf.ethz.ch/mailman/listinfo/oberon
More information about the Oberon
mailing list