GPC fails to detect incompatible type errors between two or more new-pointer-type defined types where the same domain-type is used in new-type type-denoters. An example demonstrating the bug:
{$extended-pascal} program grp12(output);
type t1 = ^integer; t2 = ^integer;
var x: t2;
procedure foo(p: t1); begin end;
begin foo(x); {WRONG - incompatible types} writeln('FAIL'); end.
Although both t1 and t2's new-pointer-type type-denoter have the same domain-type, t1 and t2 are distinctly different types. Therefore, t1 and t2 aren't assignment-compatible types (per ISO 10206 paragraph 6.4.6) and the foo(x) call is illegal since the actual-parameter type (t2) isn't assignment-compatible with the formal-paramter type (t1) as required by ISO 10206 paragraph 6.7.3.2.
The compiler I used was the latest version of Mac OS X GPC that Adriaan built and made available for downloading. The specs:
Reading specs from /Developer/Pascal/gpc345u2/lib/gcc/powerpc-apple-darwin8/3.4.5/specs Configured with: ../gcc-3.4.5/configure --enable-languages=pascal,c --enable-threads=posix --target=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --build=powerpc-apple-darwin8 --prefix=/Developer/Pascal/gpc345u2 Thread model: posix gpc version 20051116, based on gcc-3.4.5
P.S. This bug was originally found by Mike Hore and discussed on the MacPascal mailing list. The above example is a distilled version of the problem he found while working with Mac OS X GPC and the Mac OS X GPCPInterfaces.
Gale Paeper gpaeper@empirenet.com
GPC fails to detect incompatible type errors between two or more new-pointer-type defined types where the same domain-type is used in new-type type-denoters. An example demonstrating the bug:
This has been discussed (Sept) before under the thread "Type compatibility rules?"
See http://www.gnu-pascal.de/crystal/gpc/en/thread12738.html
Enjoy, Peter.
{$extended-pascal} program grp12(output);
type t1 = ^integer; t2 = ^integer;
var x: t2;
procedure foo(p: t1); begin end;
begin foo(x); {WRONG - incompatible types} writeln('FAIL'); end.
Although both t1 and t2's new-pointer-type type-denoter have the same domain-type, t1 and t2 are distinctly different types. Therefore, t1 and t2 aren't assignment-compatible types (per ISO 10206 paragraph 6.4.6) and the foo(x) call is illegal since the actual-parameter type (t2) isn't assignment-compatible with the formal-paramter type (t1) as required by ISO 10206 paragraph 6.7.3.2.
The compiler I used was the latest version of Mac OS X GPC that Adriaan built and made available for downloading. The specs:
Reading specs from /Developer/Pascal/gpc345u2/lib/gcc/powerpc-apple-darwin8/3.4.5/specs Configured with: ../gcc-3.4.5/configure --enable-languages=pascal,c --enable-threads=posix --target=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --build=powerpc-apple-darwin8 --prefix=/Developer/Pascal/gpc345u2 Thread model: posix gpc version 20051116, based on gcc-3.4.5
P.S. This bug was originally found by Mike Hore and discussed on the MacPascal mailing list. The above example is a distilled version of the problem he found while working with Mac OS X GPC and the Mac OS X GPCPInterfaces.
Gale Paeper gpaeper@empirenet.com
Gale Paeper wrote:
GPC fails to detect incompatible type errors between two or more new-pointer-type defined types where the same domain-type is used in new-type type-denoters.
This was reported before by Peter N. Lewis, http://www.gnu-pascal.de/crystal/gpc/en/mail12738.html.
Regards,
Adriaan van Os