I just wanted to highlight that these cases as legal and I presume not uncommon, particularly if values are deserialized and typecasted.

It seems that there is no way for compiler to know if the result has indeed being initialized by reason of enumeration of valid values, because one has also account for invalid values.

I think that compiler should always warn (as it does now) if result is not initialized against all possible cases.

Denis


On 05/06/2017 18:59, Jonas Maebe wrote:
That is why I said "If range checking is off there or disabled via an explicit type cast, then the result is undefined by definition." You use an explicit typecast above.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to