[Lazarus] 'with' is evil, isn't it?
Michael Schnell
mschnell at lumino.de
Thu Aug 4 09:38:21 CEST 2011
On 08/04/2011 08:10 AM, Sven Barth wrote:
>
> The code that calculates the indices and handles other references
> could have side effects, so the compiler would not be able to optimize
> them. If you use this code once inside the "with"-clause you tell the
> compiler to do that calculation only once and that you are aware of
> possible side effects (or thus not occuring side effects).
>
OK, with C a possible compiler-generated the hidden pointer variable is
as "non-volatile" as an explicit variable without a "volatile" spec
would be, while in Pascal virtually everything is considered volatile.
this in fact might ask for side-effects.
-Michael
More information about the Lazarus
mailing list