[fpc-devel] Dangerous optimization in CASE..OF

lazarus at kluug.net lazarus at kluug.net
Sat Jul 15 21:33:10 CEST 2017


Am Sa., Jul. 15, 2017 21:07 schrieb Jonas Maebe :
On 15/07/17 20:52, lazarus at kluug.net (mailto:lazarus at kluug.net) wrote:
On one hand, you try to be very fundamental about enums - you say that 
only declared enum values are valid. And there is no zero value for 
TMyEnum. TMyEnum is declared as follows:

TMyEnum = (one = 1, two);

TMyEnum is not a number so it cannot be initialized to zero.

I have said from the start that it is possible to store invalid values 
in variables through the use of a.o. pointers (which is what the class 
zeroing does), explicit typecasts and assembly.

In this case you must not restrict us to work with invalid values in a deterministic way.

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


More information about the fpc-devel mailing list