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

Sven Barth pascaldragon at googlemail.com
Thu Dec 12 17:05:53 CET 2019


Michael Van Canneyt <michael at freepascal.org> schrieb am Do., 12. Dez. 2019,
15:34:

> > It was already mentioned, that the [] can be dropped if the array has
> > *exactly one* element.
>
> Not sure what you mean here, but even if there is only 1 argument, today
> the [] cannot be dropped:
>
> home:~> cat tf.pp
> program tf;
>
> uses sysutils;
>
> begin
>    writeln(Format('%s','huh?'));
> end.
> home:~> fpc tf.pp
> tf.pp(6,29) Error: Incompatible type for arg no. 2: Got "Constant String",
> expected "Array Of Const"
> tf.pp(8) Fatal: There were 1 errors compiling module, stopping
> Fatal: Compilation aborted
> Error: /usr/local/bin/ppcx64 returned an error exitcode
>

For array of const it is not allowed, but any other open array parameter
allows it.

Regards,
Sven

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


More information about the fpc-devel mailing list