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

            Bug ID: 109496
           Summary: Cannot pass a constant char to an array of char formal
                    parameter
           Product: gcc
           Version: 13.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: ---

If a constant char is passed to an ARRAY OF CHAR formal parameter then the
parameter contains the address of the value of the char.  It should promote a
char to a string.

MODULE singlechar ;

FROM libc IMPORT printf, exit ;
FROM StrLib IMPORT StrLen ;


PROCEDURE input (a: ARRAY OF CHAR) ;
BEGIN
   IF StrLen (a) # 1
   THEN
      printf ("string length is not 1, but %d\n", StrLen (a)) ;
      exit (1)
   END
END input ;


BEGIN
   input (015C) ;
   printf ("successful test, finishing\n")
END singlechar.

Reply via email to