[fpc-devel] 019605: Safety check for "const s: string" (similar to Range or Overflow checks)

Flávio Etrusco flavio.etrusco at gmail.com
Thu Jun 23 22:06:51 CEST 2011


>
>>> On top of what I already wrote on mantis. I believe my initial idea can
>>> be further simplified.
>>>
>>> Given:  procedure Foo(const s1, s2: string);
>>
>> What about records, arrays etc. containing ref. counted types?
>
> This case is shlighly different.
>(...)

I suppose Florian already knows that, he just meant it's basically the
same programming/coding error. And also guess he meant "where do we
stop"? ;-)
Maybe just adding the option to disable the const optimization and
letting the programmer figure out whether it fixes or not a bug is a
good enough addition?

Best regards,
Flávio



More information about the fpc-devel mailing list