On 16 Nov 2009, at 14:50, Anthony Walter wrote:

There is a problem with the above code on FPC when you change calling
conventions of A.

Const indeed behaves differently depending on the calling convention. With register and stdcall, we emulate Delphi. With mwpascal, we emulate MetroWerks Pascal. With cdecl, we emulate C compilers. In C compilers, adding "const" does not change the way the parameter is passed: they are still passed by value. There have been lots of discussions in the past about adding something like constvar or constref, but nothing has ever come from it.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to