[fpc-devel] Minor debate with ISO standard on case blocks

Marco Borsari borsa77 at libero.it
Wed Jul 31 08:26:58 CEST 2019


On Wed, 31 Jul 2019 01:26:23 +0200
Martok <listbox at martoks-place.de> wrote:

> Of course, if you wanted a run-time error you would need to insert a run-time
> check, and 'some people' seemed to be hell-bent on saving these 2 cycles at any
> cost.
> 
> The patch to switch from option a1) to a2) would be straightforward, fix 32079
> and insert a default otherwise clause that raises a RunError in -Miso. But the
> question is again, does Freepascal actually aim to be compliant with anything,
> or just have a compatible syntax and do its own thing from there?

It seems to me that the problem of a lack of correspondence in a case
statement list should be of the same level of attention of the index
limits of an array, except there is no memory corruption risk. The
solution could be to insert a run time check in presence of the
switch {$R+}, if the latter is allowed in iso mode.

Greetings, Marco Borsari
-- 
Simplex sigillum veri


More information about the fpc-devel mailing list