[fpc-pascal] readonly variables

Anthony Walter sysrpl at gmail.com
Mon Nov 30 00:21:30 CET 2009


> So it seems that passing them by value actually corresponds to what the Delphi docs say.

Jonas, I agree, the documentation definitely does address the issue,
which was where that conversation was derailed.

Regarding actual implementation, I previously posted the full source
to a test program with the results. The conclusion was that Delphi and
FPC work the same, except when the convention is changed to cdecl.
Under cdecl FPC returns "R is a structure on the stack" and Delphi
returns "R refers to a reference on the stack".

If anyone wants to repeat the tests, the source code is located under
the link you last provided. Just change the calling convention of
function A to see how the compiler handles parameters differently.



More information about the fpc-pascal mailing list