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

            Bug ID: 113889
           Summary: Incorrect constant string value if declared in a
                    definition module
           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: ---

As reported on the gm2 mailing list.  Constant strings are not handled
correctly if they are exported from a definition module (and appear as a nul
string).

DEFINITION MODULE Foo;

  CONST Bar = "Blech";

END Foo.

IMPLEMENTATION MODULE Foo;
END Foo.

MODULE test_foo;

  IMPORT Foo;

  FROM STextIO IMPORT WriteString, WriteLn;
  FROM Foo     IMPORT Bar;

BEGIN
  WriteString("Bar => ");
  WriteString(Foo.Bar);
  WriteLn;

  WriteString("Bar => ");
  WriteString(Bar);
  WriteLn;
END test_foo.

At test program run time, Bar becomes an empty string, with the following 
result:

Bar =>
Bar =>

Reply via email to