Wiki tells about problems the dfa encounters:
http://wiki.freepascal.org/FPC_New_Features_3.0#Node_dfa_for_liveness_analysis
In this code if "b" is true in the first test, it will be true also in
the second test, thus using "i" is safe and valid.
...
if b then
i:=1;
writeln;
if b
Result is undefined if caller passes an out of range value.
An example: TControlBorderSpacing.GetSpace(TAnchorKind(-1));
Result is indeed not initialized, so silencing this message may be harmful.
Denis
On 05/06/2017 15:22, Juha Manninen wrote:
Wiki tells about problems the dfa encounters:
On 05/06/17 18:46, Denis Kozlov wrote:
Result is undefined if caller passes an out of range value.
That would be an error at the time this out-of-range value would be
converted to TAnchorKind. If range checking is off there or disabled via
an explicit type cast, then the result is undefined
For some reason my reply went only to Denis first. Another try here...
On Mon, Jun 5, 2017 at 7:46 PM, Denis Kozlov wrote:
> Result is undefined if caller passes an out of range value.
> An example: TControlBorderSpacing.GetSpace(TAnchorKind(-1));
> Result is indeed not
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.
P.S. Same behaviour for Lazarus
On 05/06/17 19:39, Denis Kozlov 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
On Monday, June 5, 2017, Denis Kozlov 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
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
On 05.06.2017 20:37, Denis Kozlov wrote:
>
> I just wanted to highlight that these cases as legal and I presume not
> uncommon, particularly if values are deserialized and typecasted.
They are legal in the sense that they result in undefined behavior and
in that case the compiler is free to act
On 05/06/17 20:37, Denis Kozlov wrote:
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.
>
> I just wanted to highlight that these
On Mon, Jun 5, 2017 at 9:37 PM, Denis Kozlov wrote:
> I just wanted to highlight that these cases as legal and I presume not
> uncommon, particularly if values are deserialized and typecasted.
No they are not legal. Why you write this nonsense?
Values outside the range dictated
11 matches
Mail list logo