[fpc-pascal] fpc 2.3.1 doesn't allow to pass literal constants as formal const parameter

Peter Vreman peter at freepascal.org
Thu Mar 6 16:49:00 CET 2008


> Currently fpc 2.3.1 cannot build lazarus anymore. It fails on lines like
> MyStream.Write(' ',1);
>
> The write method is declared as
>    function Write(const Buffer; Count: Longint): Longint
>
> Why isn't passing literal constant to a formal const parameter allowed
> anymore?

1. It is passed by value and not by reference.
2. You don't know the size of the value.
3. It is delphi compatible

Peter




More information about the fpc-pascal mailing list