[fpc-devel] Data flow analysis (dfa) and "case ... of"
Juha Manninen
juha.manninen62 at gmail.com
Mon Jun 5 20:14:29 CEST 2017
On Monday, June 5, 2017, Denis Kozlov <dezlov at gmail.com> wrote:
> I have just created a new GUI application, enabled range checking "-Cr"
> and executed the following:
> ShowMessage(IntToStr(Form1.BorderSpacing.GetSpace(TAnchorKind(-1))));
> The displayed value is a semi-random integer. No compiler errors or
> run-time errors.
>
The typecast suppresses a range error in your code.
However the LCL method GetSpace should give an error if it is compiled with
-Cr.
So, build Lazarus + LCL with profile "Debug IDE" and try again.
Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20170605/943b3408/attachment.html>
More information about the fpc-devel
mailing list