[fpc-devel] Evaluation order in expressions

Ondrej Pokorny lazarus at kluug.net
Tue Jul 30 09:41:25 CEST 2019


On 30.07.2019 08:55, Jonas Maebe wrote:
> Delphi evaluates e.g. all parameters to subroutine calls from left to 
> right, which FPC does not guarantee.

If I am not mistaken Delphi doesn't guarantee this either. I remember I 
"learned it by doing" quite some time ago and I don't think I used FPC 
at that point, so it must have been Delphi.

A quick Google search revealed https://stackoverflow.com/a/11010685 - 
yes, when I run the code from the answer in Delphi 32bit the right 
"SideEffect(2)" call is executed before the left "SideEffect(1)" call.

Ondrej



More information about the fpc-devel mailing list