[fpc-devel] Const optimization is a serious bug

reynolight reynolight at googlemail.com
Thu Jul 7 21:05:47 CEST 2011


Am 07.07.2011 19:54, schrieb Alexander Klenin:
> ...
> The problem with this particular feature is that *nobody* seems to use
> it correctly --
> if even compiler developers did not get it right, what can we expect
> from ordinary
> users?

Here I am. Probably the most ordinary FP user on the planet. Just let me
throw in this discussion, to be honest, for years, I do not have any
issues with const parameters, related to this debate. The "contract" is
completely ok for me. And I always understood it as my promise to the
compiler, as Michael pointed out. Not at all reversely, as the
compiler's commitment.

So I am perfectly happy with this promise. Except, sometimes, when an
related error is thrown, I have to remember again, that "const"
automatically excludes dynamic function or operation results as a
parameter, as well.

>From my personal point of view, THIS has nothing to do with the promise,
not to modify a parameter, declared as "const", during the called
routine is running. But I cannot imagine that there is any chance for a
change, since it's probably always done like this, in each and every
version of the compiler.

Reyno.



More information about the fpc-devel mailing list