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

Michael Van Canneyt michael at freepascal.org
Mon Dec 20 20:52:02 CET 2021



On Mon, 20 Dec 2021, Bart via fpc-devel wrote:

> 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.

That's what I meant with dirty tricks. There are many ways to do so.

Michael.


More information about the fpc-devel mailing list