[fpc-devel] [Suggestion] Enumeration range-check intrinsic

Sven Barth pascaldragon at googlemail.com
Fri Jul 5 08:08:06 CEST 2019


Jonas Maebe <jonas at freepascal.org> schrieb am Do., 4. Juli 2019, 21:21:

> On 03/07/2019 09:26, Ondrej Pokorny wrote:
> > On 02.07.2019 23:34, Jonas Maebe wrote:
> >> Invalid data means undefined behaviour, always. "is" is not a special
> >> case that is immune to this.
> >
> > Don't you really see the need to handle invalid data with a /defined/
> > behavior?
>
> My point is that is impossible to do so, so trying to do it in a way
> that works in some/most cases, is much more dangerous than categorically
> refusing to try to do it, as it creates a false sense of security.
>

Then how would you read data from e.g. a stream into an enum or subrange if
the stream may contain invalid data?

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190705/b1575007/attachment.html>


More information about the fpc-devel mailing list