[fpc-devel] Const optimization is a serious bug

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Jul 11 06:35:06 CEST 2011


Alexander Klenin schrieb:
> On Mon, Jul 11, 2011 at 04:09, Hans-Peter Diettrich
> <DrDiettrich1 at aol.com> wrote:
>>>> If you want to introduce different keywords, then please different for
>>>> beforementioned cases. E.g.
>>>> constval x: integer; //all value-types
>>>> constref r: Trecord; //also ShortString
>>>> const??? o: TObject; //all references, except following
>>>> const??? s: AnsiString; //all managed types
>>> I am not quite sure what are you asking here. Can you elaborate?
>> To which data type do you want apply your "constval" modifier, with which
>> concrete effects?
> 
> To any datatype, of course. The result should be:
> 1) Parameter is passed by value

How to pass objects by value?
Records with embedded AnsiStrings or other managed types?

DoDi




More information about the fpc-devel mailing list