[fpc-pascal] const records passed incorrectly

Anthony Walter sysrpl at gmail.com
Mon Nov 16 16:20:50 CET 2009

On Mon, Nov 16, 2009 at 9:51 AM, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
> I was merely answering your question why we do it differently than Delphi,
> even though Delphi is generally the de facto standard. I was trying to
> explain that we did not do it differently simply because our way was the
> right one and Delphi's way the wrong one, or out of spite or so. But it
> appears that you interpreted my answer in exactly the opposite sense (that
> we won't change it out of spite).

Yup. Got that. It's just that I've heard it a few times before and was
a bit confounded by the rational. No

> The main problem with changing it now would obviously be that it would break
> backwards compatibility with existing code. It could still be done in Delphi
> mode onlu, of course, but changing the behaviour of a calling convention
> (which is normally an ABI issue) based on a language syntax mode feels...
> not right.

I don't believe this fix would cause any problems with existing code.
The fix has been when using cdecl to declare const structures as
pointers to structures. That is to say:

function nanosleep(RequestedTime: PTimeSpec; Remaining: PTimeSpec):
Integer; cdecl;

Which would operate just the same.

Thank you all for your courtesy. I understand the issue better now.

I'll look into how to help out with the compiler development soon and
hopefully help improve FPC.

More information about the fpc-pascal mailing list