gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] Some bugs in 1.0


From: Dmitry Shatrov
Subject: [Gm2] Some bugs in 1.0
Date: Sat, 18 Dec 2010 17:35:03 +0300

Hi list,

I've got two supposed bugs and one feature request. I've collected these from my effort to compile an old program for JPI TopSpeed Modula-2 with gm2. Here we go:


1. The following segfaults. It looks like aliases are broken:

MODULE test;

(* Uncommenting this doesn't help
VAR
    my_var : CARDINAL;
*)

CONST my_alias = test.my_var;

BEGIN
END test.


2. The following doesn't compile, i.e. we cannot pass a char as a parameter if the function that we're calling expects a string. As far as I know, ISO says that this should be allowed (JPI allows that as well).

MODULE test;

PROCEDURE my_func (str : ARRAY OF CHAR);
BEGIN
END my_func;

BEGIN
    my_func (261C);
END test.


3. (A feature request, I guess) The old code contains lots (lots!) of casts that gm2 disallows because of different source and destination type sizes. Perhaps there could be an option to allow such casts? Here's an example:

MODULE test;

VAR
    my_char : CHAR;
    my_card : CARDINAL;

BEGIN
    my_char := 0C;

    my_card := VAL (CARDINAL, my_char); (* THIS WORKS IN GNU Modula-2 *)
    my_card := CARDINAL (my_char);      (* THIS WORKS IN JPI TopSpeed Modula-2 *)
END test.



Best regards,
Dmitry

reply via email to

[Prev in Thread] Current Thread [Next in Thread]