Peter Vreman schreef:
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?


I see this change is intentional, but I don't understand it completely yet.

1. It is passed by value and not by reference.

The compile could decide to pass by reference, couldn't it.

2. You don't know the size of the value.

The caller knows the size, doesn't it. Why do you need to know the size?

3. It is delphi compatible


At last, one reason I understand :-).

Thanks,
Vincent
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to