public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/109729] New: gm2 (14.0.0) does not like a CHAR type FOR loop control variable any more
@ 2023-05-04  9:01 gaius at gcc dot gnu.org
  2023-05-04  9:07 ` [Bug modula2/109729] " gaius at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-05-04  9:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109729
           Summary: gm2 (14.0.0) does not like a CHAR type FOR loop
                    control variable any more
           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: ---

Copied from the gm2 mailing list:

"""
just recognised that gm2 (14.0.0) does not like a CHAR type FOR loop control
variable any more ... :-)

Here the simplified code reproducing the error

MODULE RealConvert;

FROM ConvTypes IMPORT ConvResults;

VAR   RKonv        : ARRAY ['0'..'9'] OF REAL;
      IKonv        : ARRAY ['0'..'9'] OF CARDINAL;
      KommaZeichen : CHAR; (* Macht 1,0 statt 1.0 in Ausgaben m"oglich. *)
      Ziffern      : ARRAY [0..11] OF CHAR; (* + 0C *)


VAR   c : CHAR;
      p : CARDINAL;
BEGIN
      (* Does not work ...  *)
      p:=0;
      FOR c:='0' TO '9' DO RKonv[c]:=VAL(REAL,p); IKonv[c]:=p; INC(p); END;

      (* This is essentially doing the same as the loop before - does work *)

      IKonv["0"] :=  0;   IKonv["1"] :=  1;   IKonv["2"] :=  2;
      IKonv["3"] :=  3;   IKonv["4"] :=  4;   IKonv["5"] :=  5;
      IKonv["6"] :=  6;   IKonv["7"] :=  7;   IKonv["8"] :=  8;
      IKonv["9"] :=  9;

      RKonv["0"] :=  0.0; RKonv["1"] :=  1.0; RKonv["2"] :=  2.0;
      RKonv["3"] :=  3.0; RKonv["4"] :=  4.0; RKonv["5"] :=  5.0;
      RKonv["6"] :=  6.0; RKonv["7"] :=  7.0; RKonv["8"] :=  8.0;
      RKonv["9"] :=  9.0;

      KommaZeichen:='.';
      Ziffern := "0123456789"; (* wg. GM2 *)

END RealConvert.
"""

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-28 14:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04  9:01 [Bug modula2/109729] New: gm2 (14.0.0) does not like a CHAR type FOR loop control variable any more gaius at gcc dot gnu.org
2023-05-04  9:07 ` [Bug modula2/109729] " gaius at gcc dot gnu.org
2023-05-04 14:18 ` gaius at gcc dot gnu.org
2023-05-04 17:16 ` cvs-commit at gcc dot gnu.org
2023-05-04 17:22 ` gaius at gcc dot gnu.org
2023-07-28 14:12 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).