https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115330

            Bug ID: 115330
           Summary: Incorrect definition module name used in the error
                    message when reporting on an opaque type
           Product: gcc
           Version: 15.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: ---

The error message reporting on an opaque type not being a pointer generates an
module name in the error.  For example:

$ cat Num.def 
DEFINITION MODULE Num ;

TYPE
   NumType ;

PROCEDURE add (left, right: NumType) : NumType ;

END Num.

$ cat Num.mod 
IMPLEMENTATION MODULE Num ;

TYPE
   NumType = CARDINAL ;

PROCEDURE add (left, right: NumType) : NumType ;
BEGIN
   RETURN left+right
END add ;

END Num.

$ gm2 Num.mod 
Num.mod:4:14: error: In definition module ‘wrapc’: opaque type (NumType) should
be equivalent to a POINTER or an ADDRESS
    4 |    NumType = CARDINAL ;
      |              ^~~~~~~~
Num.mod:4:14: error: if you really need a non POINTER type use the
-fextended-opaque switch



wrapc is incorrect - it should be Num.

Reply via email to