From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14A19385781A; Tue, 23 Mar 2021 02:11:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14A19385781A From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/99711] Crash when reading an allocated character array in namelist Date: Tue, 23 Mar 2021 02:11:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 02:11:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99711 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #2 from kargl at gcc dot gnu.org --- (In reply to Jerry DeLisle from comment #1) > F2018 standard section 13.10.3 List-directed Input >=20 > There is a note NOTE 13.29 at the end of the first sub-section 13.10.3.1" >=20 > "An allocatable, deferred-length character effective item does not have i= ts > allocation status or allocated length changed as a result of list-directed > input." >=20 > This implies that if the strings of the array are not already allocated t= o a > resonable length, for example a string of blanks, then the read will atte= mpt > to transfer the file contents into unallocated strings. Doesn't the line allocate( character(len=3D10) :: cbulist_ru(5) ) that is the first executable statement in the program allocate an array of 5 strings with length 10?=