[fpc-devel] calling convention on mac

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Nov 28 22:15:47 CET 2012


On 28 Nov 2012, at 22:04, Carlo Ko wrote:

> Op 28-11-2012 21:50, Jonas Maebe schreef:
>> 
>> On 28 Nov 2012, at 21:36, Martin wrote:
>> 
>>> It does not matter if I compile it with stdcall, cdecl, pascal. The below on a 32 bit intel mac (fpc 2.6.0) always returns result in 2 registers (eax, edx)
>>> 
>>> Is there a way to change this (some declaration in the source, some switch)?
>> 
>> It's a bug that's fixed in trunk: http://wiki.freepascal.org/User_Changes_Trunk#Location_of_certain_function_result_types
> 
> As the author of pascalscript, I wasn't aware of this issue, however now I'm in a dilemma. FPC breaks things very often, and that url shows just one of these.

It's not useful to talk in general terms when discussing specific issues. Would you have preferred that this particular bug had remained in the compiler, in the interest of backward compatibility?

Additionally, the URL does not just show "one of these", but a "bunch of those". We do our best to document every such case, and always in the same place on the wiki.

> If I want to fix this bug in Pascal Script, I have to undo the fix in 6-12 months again (or use version specific defines).

The correct fix is indeed an version-specific define.

> I'm getting a bit frustrated with FPC changing things back and forward all the time (this isn't a new thing, this has been going on since I first ported it to FPC).

"back and forward" suggests that we change it in one way in one version, and then back again to the old behaviour in a successive version. Afaik that has never happened until now. We do occasionally fix bugs that break backward compatibility, but as explained above I don't see an alternative to leaving in such bugs forever.


Jonas


More information about the fpc-devel mailing list