https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112893
Bug ID: 112893
Summary: gm2 fails to detect procedure address actual parameter
is incompatible with cardinal formal parameter
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: modula2
Assignee: gaius at gcc dot gnu.org
Reporter: gaius at gcc dot gnu.org
Target Milestone: ---
gm2 silently compiles the following code:
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.
whereas it should detect that func is the address of a procedure and this is
incompatible with the cardinal 1st parameter of WriteCard.