Am 02.02.2016 13:38 schrieb "Andreas Berger" <andr...@thebergerclan.org>:
>
>
> On Tue 02/02/2016 09:27, Jonas Maebe wrote:
>>
>>
>> The parameter evaluation order issue is irrelevant in this context:
Delphi guarantees left-to-right (or used to anyway, this may have changed),
FPC doesn't guarantee anything.
>>
> Wow, what's this? I never knew this. I have been using Borland products
since TP 1.0 and for me left-to-right is automatic, I don't even think
about it. If FPC doesn't guarantee this my code is full of potential
problems.
> BTW using left-to-right does not mean non-robust code if it is guaranteed.

FPC indeed does not guarantee the evaluation order (and that's even
documented AFAIK). It might change the evaluation order to generate better
code. It only guarantees that each parameter is evaluated exactly once
(though in case of expressions without calls it might reuse results in
certain optimization settings, I don't know that currently though) and that
the parameters are passed in the correct order.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to