On Tue, 30 Jul 2019, Ondrej Pokorny wrote:
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.
I think they updated the documentation meanwhile:
http://docwiki.embarcadero.com/RADStudio/Rio/en/Procedures_and_Functions_(Delphi)#Calling_Conventions
So you can see it depends on the calling convention.
Michael.
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel