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

            Bug ID: 120188
           Summary: documented example does not work
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: bruno at clisp dot org
  Target Milestone: ---

The first example in https://gcc.gnu.org/onlinedocs/gm2/Semantic-checking.html
does not work:

$ cat assignvalue.mod
MODULE assignvalue ;  (*!m2iso+gm2*)

PROCEDURE bad () : INTEGER ;
VAR
   i: INTEGER ;
BEGIN
   i := -1 ;
   RETURN i
END bad ;

VAR
   foo: CARDINAL ;
BEGIN
   (* The m2rte plugin will detect this as an error, post
      optimization.  *)
   foo := bad ()
END assignvalue.

$ gm2 -g -fsoft-check-all -O2 -c assignvalue.mod

Expected output: Diagnostics, as documented, but with a reasonable column
number. (Column number 0 is not valid, according to
https://www.gnu.org/prep/standards/html_node/Errors.html : "column numbers
should start from 1 at the beginning of the line".)

Actual output: No diagnostic.

Reply via email to