[fpc-devel] Minor doc error about "const param"

Bart bartjunk64 at gmail.com
Mon Dec 20 20:29:02 CET 2021

On Mon, Dec 20, 2021 at 12:07 PM Martin Frb via fpc-devel
<fpc-devel at lists.freepascal.org> wrote:

> https://www.freepascal.org/docs-html/current/ref/refsu67.html#x183-20700014.4.4
>  > Specifying a parameter as Constant is giving the compiler a hint that
> the contents of the parameter will not be changed by the called routine.

Actually it is a contract between the programmer and the compiler,
telling the compiler that the value of sais constant parameter will
not be altered in any way.
The compiler will enforce this as much as it can, but it is up to the
programmer to not have other processes alter the value of that
parameter, whilst that function is still running.

Any side effects of circumventing the compilers efforst to enforce
this are at your own risks.


More information about the fpc-devel mailing list