Waldek Hebisch wrote:
Prof A Olowofoyeku wrote:
It is with the "move" call that I actually don't need the compiler complaining about dereferencing untyped pointers.
I guess in general you mean dereferencing untyped pointers to pass then via var parameters. We could in principle allow such use while disallowing all other uses, trough it is somewhat tricky to do in the compiler (at first glance it looks almost impossible,
Indeed.
but I have found rather simple way to do this).
Which way is this (as I'd judge the klumsiness of a feature also by the amount of work it takes to implement)? Would you add a new tree code for pointer dereferencing, or have you found an easier way?
New tree code. I see no simpler way.
It compiles with my GPC 20050331, but I consider this as a bug.
What exactly? The following does not compile with 20050331.
Please disregard the above, I forgot to erase the sentence.
The preferred method is:
{$local delphi} move (p, values^[count]^, size); { will now compile } {$endlocal}
the `{$endlocal}' directive should restore the exact setting in force before `{$local'.
BTW, unrelated to the original topic, I had wondered about this. What about directives between `{$local}' and `{$endlocal}', should they also be restored? It might seem more consistent, and is probably easier to implement, if so. It would, of course, mean that `{$local foo}{$bar}' and `{$local foo,bar}' would be equivalent, but well, why not?
Yes, `{$endlocal}' should restore _state_ corresponding to `{$local}'. IMHO it is only sane way.