<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Ryan Joseph via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>> schrieb am So., 8. Dez. 2019, 23:26:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On Dec 8, 2019, at 2:30 PM, Sven Barth via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org" rel="noreferrer noreferrer" target="_blank">fpc-devel@lists.freepascal.org</a>> wrote:<br>
> <br>
> And no, your patch WILL NOT allow that. We've consciously decided AGAINST implementing varargs functions in Pascal (see <a href="https://wiki.freepascal.org/User_Changes_2.6.0#Array_of_const_parameters_and_cdecl_routines" rel="noreferrer noreferrer noreferrer" target="_blank">https://wiki.freepascal.org/User_Changes_2.6.0#Array_of_const_parameters_and_cdecl_routines</a> ) and we DO NOT WANT to support this.<br>
<br>
Sorry to interject but I'm just curious why this hardline stance was taken.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">First of Object Pascal supports "array of const" which is safer due to a added type field for each entry. </div><div dir="auto"><br></div><div dir="auto">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: <a href="https://blog.nelhage.com/2010/10/amd64-and-va_arg/">https://blog.nelhage.com/2010/10/amd64-and-va_arg/</a></div><div dir="auto"><br></div><div dir="auto">We don't want to spend this effort when Object Pascal itself provides a cross platform mechanism. </div><div dir="auto"><br></div><div dir="auto">Please note that *calling* such functions is easier as it follows the usual ABI rules for N parameters. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>