[fpc-devel] Question on constref

Adriaan van Os adriaan at adriaan.biz
Thu Feb 2 02:41:43 CET 2023


Sven Barth via fpc-devel wrote:

> There is no full documentation for that parameter modifier (someone 
> might want to file a bug report for that), but the documentation for 
> “const” ( 
> https://www.freepascal.org/docs-html/current/ref/refsu67.html#x183-20700014.4.4 
> ) contains this:
> 
> === doc begin ===
> 
> Contrary to Delphi, no assumptions should be made about how const 
> parameters are passed to the underlying routine. In particular, the 
> assumption that parameters with large size are passed by reference is 
> not correct. For this the constref parameter type should be used, which 
> is available as of version 2.5.1 of the compiler.
> 
> === doc end ===

On debate, see FPC issue 17442.

Regards,

Adriaan van Os


More information about the fpc-devel mailing list