Prof A Olowofoyeku (The African Chief) wrote:
Is there a switch or compiler directive?
Currently only `--borland-pascal' and `--delphi' disable it (which we don't usually recommend to use, as you know).
Yes. I would prefer not to use either of these. But it would also be nice to be able to disable this error with a switch/directive of its own. I had assumed that {$X+} would disable this error (since anyone relying on that switch is already swimming in dangerous waters), but it seems not. A warning is quite fine if it is thought too dangerous to permit easy disabling (for those who treat all warnings as errors, the effect would be the same).
I'm now adding a new option `--[no-]untyped-pointers' which will be coupled to `--[no-]extended-syntax' (and not to the dialect setting) to turn the error into a warning. OTOH, if not set, there will now be errors instead of warnings for arithmetics and `New' applied to untyped pointers.
So you could then use `{$X+}' (globally or locally, as you prefer) and `{$W-}' (locally, by all means) for the critical statements.
Waldek Hebisch wrote:
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.
We could still do this in addition. But I'm not sure it's worth the effort since the alternatives (using a pointer to a byte or similar) are readily available ...
Frank