gm2
[Top][All Lists]
Advanced

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

update on the address/procedure cardinal incompatability checking


From: Gaius Mulley
Subject: update on the address/procedure cardinal incompatability checking
Date: Thu, 07 Dec 2023 03:47:57 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi,

Re example code below:

$ cat gcc/testsuite/gm2/pim/fail/proccard.mod
MODULE proccard ;

FROM NumberIO IMPORT WriteCard ;
FROM StrIO IMPORT WriteString, WriteLn ;

PROCEDURE func () : CARDINAL ;
BEGIN
   RETURN 42
END func ;


BEGIN
   WriteString ('the value is: ') ; WriteCard (func, 5) ; WriteLn
END proccard.

v1 of the fix is on bugzilla as a patch (not yet git committed or pushed
as the implementation conflicts with pim rules of address and cardinal
compatibility):

$ gm2 proccard.mod 
proccard.mod:13:48: error: 1st parameter type failure between actual parameter 
type ‘ADDRESS’ and the formal type ‘CARDINAL’
   13 |    WriteString ('the value is: ') ; WriteCard (func, 5) ; WriteLn
      |                                                ^~~~
proccard.mod:13:48: error: ‘ADDRESS’ and ‘CARDINAL’ are incompatible in this 
context

but at least the error messages are tidier

regards,
Gaius



reply via email to

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