[fpc-devel] C-block reference syntax (blocker for 3.2)

Sven Barth pascaldragon at googlemail.com
Tue Dec 10 17:38:49 CET 2019


Ryan Joseph via fpc-devel <fpc-devel at lists.freepascal.org> schrieb am So.,
8. Dez. 2019, 23:26:

>
>
> > On Dec 8, 2019, at 2:30 PM, Sven Barth via fpc-devel <
> fpc-devel at lists.freepascal.org> wrote:
> >
> > And no, your patch WILL NOT allow that. We've consciously decided
> AGAINST implementing varargs functions in Pascal (see
> https://wiki.freepascal.org/User_Changes_2.6.0#Array_of_const_parameters_and_cdecl_routines
> ) and we DO NOT WANT to support this.
>
> Sorry to interject but I'm just curious why this hardline stance was taken.
>

First of Object Pascal supports "array of const" which is safer due to a
added type field for each entry.

Secondly adding support for implementing varargs functions would mean to
add compiler intrinsics to retrieve the parameters for each platform (as
not all platforms have a calling convention that allows to use pointer
arithmetic like i386 does). Take a look at this blog entry for the x86_64
Sys V ABI: https://blog.nelhage.com/2010/10/amd64-and-va_arg/

We don't want to spend this effort when Object Pascal itself provides a
cross platform mechanism.

Please note that *calling* such functions is easier as it follows the usual
ABI rules for N parameters.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20191210/cd768376/attachment.html>


More information about the fpc-devel mailing list