From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E86C63865483; Tue, 16 May 2023 21:41:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E86C63865483 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684273276; bh=jrVWJG9iBsJadl/d5YXBokIiMvgyK2m4V9mHypUDNIU=; h=From:To:Subject:Date:From; b=uJ10m7kjthvc0tJ6xiUpITiC5DUVh/kxo/ypYBusT2y5djWutfjS9cQDIas1zLqU4 P8tcAOexJHISu8aLld57yP5kqAID5xcKhHam6EXCKJKUK6AO0vPtTZlTtlItdE5YhN IqWnilXywwoMOYPzDXUS8M3H4FADluZqRc6qbgfA= From: "gaius at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/109879] New: ReadCard and ReadInt from WholeIO have problems with leading space Date: Tue, 16 May 2023 21:41:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gaius at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: gaius at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109879 Bug ID: 109879 Summary: ReadCard and ReadInt from WholeIO have problems with leading space 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 gn2 mailing list, leading spaces are not skipped when performing ReadInt or ReadCard. module port_test10a_gm2; from ChanConsts IMPORT OpenResults, old, read, write; from IOChan IMPORT ChanId; from StdChans IMPORT StdOutChan; import StreamFile; from TextIO IMPORT SkipLine, WriteLn, WriteString; from WholeIO IMPORT ReadCard, ReadInt, WriteCard, WriteInt; procedure ReadNumbersTest(); const arr_len=3D 128; type arr_type=3D ARRAY[0..arr_len-1] of char; var cid_file: ChanId; cid_out: ChanId; file_name: arr_type; res: OpenResults; c1: cardinal; ival: integer; cval: cardinal; begin (* procedure ReadNumbersTest *) cid_out:=3DStdOutChan(); file_name:=3D'test_data'; (* create file and write (integer) numbers to it *) WriteString(cid_out, 'write (integer) numbers to file...'); WriteLn(cid_out); StreamFile.Open(cid_file, file_name, write+old, res); if res=3Dopened THEN WriteString(cid_file, ' 123'); WriteLn(cid_file); WriteString(cid_file, '234'); WriteLn(cid_file); StreamFile.Close(cid_file); end; (* if res=3Dopened *) (* (re-)open file and read numbers with ReadCard *) WriteString(cid_out, 'read numbers with ReadCard...'); WriteLn(cid_out); StreamFile.Open(cid_file, file_name, read, res); if res=3Dopened THEN for c1:=3D1 TO 2 DO ReadCard(cid_file, cval); WriteCard(cid_out, cval, 1); WriteLn(cid_out); SkipLine(cid_file); end; (* for c1 *) StreamFile.Close(cid_file); end; (* if res=3Dopened *) WriteLn(cid_out); (* (re-)open file and read numbers with ReadInt *) WriteString(cid_out, 'read numbers with ReadInt...'); WriteLn(cid_out); StreamFile.Open(cid_file, file_name, read, res); if res=3Dopened THEN for c1:=3D1 TO 2 DO ReadInt(cid_file, ival); WriteInt(cid_out, ival, 1); WriteLn(cid_out); SkipLine(cid_file); end; (* for c1 *) StreamFile.Close(cid_file); end; (* if res=3Dopened *) WriteLn(cid_out); end ReadNumbersTest; begin (* module port_test10a_gm2 *) ReadNumbersTest(); end port_test10a_gm2.=