<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 11, 2016 at 3:56 PM, silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Jan 11, 2016 at 3:41 PM, Anthony Walter <span dir="ltr"><<a href="mailto:sysrpl@gmail.com" target="_blank">sysrpl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">I believe in Delphi only external functions may use varargs. In your case you are declaring a variable, which could be assigned to a local function.</div></div></blockquote><div><br></div></span><div>You are right:</div></div></div></div></blockquote></div>[...]<br clear="all"><div><br></div><div>Fixed. I just removed the first `;`:</div><div><br></div><div>=== begin code ===</div><div>var</div><div> FmtStr: function(const fmt: PAnsiChar): PAnsiChar; cdecl varargs;<br></div><div>=== end code ===</div><div><br></div><div>Now it compiles fine in an original copy of Delphi Seattle and in the FPC from trunk (3.1.1).</div><div><br></div><div>I'm glad to compile that, but it is very strange, according EMB docs:</div><div><br></div><div>"The varargs directive works only with external routines and only with the cdecl calling convention.":</div><div><br></div><div><a href="http://docwiki.embarcadero.com/RADStudio/Seattle/en/Procedures_and_Functions#External_Declarations">http://docwiki.embarcadero.com/RADStudio/Seattle/en/Procedures_and_Functions#External_Declarations</a></div><div><br></div><div>But I saw many programmers using it in funcs declared as variable:</div><div><br></div><div><a href="http://www.swissdelphicenter.ch/torry/showcode.php?id=2114">http://www.swissdelphicenter.ch/torry/showcode.php?id=2114</a><br></div><div><a href="https://github.com/e-tobi/Delphi-Libxml2-XmlTextReader/blob/master/libxml2.pas">https://github.com/e-tobi/Delphi-Libxml2-XmlTextReader/blob/master/libxml2.pas</a><br></div><div><br></div><div>So I'm going to use it too hehe! :-)</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div>
</div></div>