On 30 Sep 2005 at 17:56, Frank Heckenbach wrote:
Waldek Hebisch wrote:
Peter N Lewis wrote:
Currently, this compiles, I would think it would give a type check error:
program peter112;
type p1 = ^MedInt; p2 = ^MedInt;
procedure doit( p: p1 ); begin end;
var p: p2; begin doit( p ); end.
Should p1 and p2 be parameter type compatible?
MWPascal complains of the type check on the parameter...?
I tried searching the docs for type compatibility, but did not find anything on the subject, perhaps I need to read the spec?
p1 and p2 are distinct types. Distinct pointer types in Pascal are always incompatible. However, gpc (incorrectly) treats poiters to the same type as compatible.
As I think I mentioned in a previous PM, this is BP compatible.
[...]
The code does compile under BP, and Delphi - but you have to enable "typed pointer" (BP) or "typed @ operator" (Delphi) - in each case, with the {$XT+} directive.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/