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 by the type system
On 05/06/2017 19:49, Jonas Maebe wrote:
The DFA simply does not take into account the result of
case-statements at all right now. If you have a "case bytevar of" with
every possible value from 0 to 255, you will still get the warning.
On 05/06/2017 19:43, Sven Barth wrote:
They are legal in
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 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 a
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 als
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 compiler errors or
> run-
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 errors.
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 1.6.4
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 initialized, so silencing
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 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:
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 then
12 matches
Mail list logo