From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3583A3851C16; Mon, 27 Jul 2020 00:45:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3583A3851C16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595810734; bh=wjpXqVABzepjGrtTXyBnLHVDP+mBynO+ZuxedL+kxQI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Wpu9OEQbX+XO0Q7o3g4RRNHFR1pL0406w6qSmNlr3mQr4jYS2MPsl6F/P3KdiRoxx 3PAwZthTTwXjXHCHVAjU7k5U85rzX47Yggq6yBamvAzwRaVLhJ/lbqb1ND9P1PT2/a 0aUPFGFNGTI/XQg1B3IaY+GSaDkSXxeUEcMrs/PI= From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/96320] gfortran 8-10 shape mismatch in assumed-length dummy argument character array Date: Mon, 27 Jul 2020 00:45:34 +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.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Mon, 27 Jul 2020 00:45:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96320 --- Comment #8 from Steve Kargl -= -- On Sun, Jul 26, 2020 at 09:35:56PM +0000, jvdelisle at charter dot net wrot= e: > > I my too simple terms, when you define the interface and then use > module procedure in the contains, all of the declarations in the > interface exist as if you had them in the declaration of the > subroutine or function in the contains. This includes all arguments > and whether or not the procedure is a subroutine or a function. >=20 > I was not aware of this either untill I saw some other code > Damian was doing earlier this week that does actually compile > fine like this with gfortran. It is a modern feature and if you > think about it, very useful in that it saves a lot of typing. > One can choose do do it either way, but this way shown truly uses > the interface to define everything. >=20 I have thought about it, and I have concluded it is rather curious programming paradigm, because ... module foo private public bar interface bar ! Make bar generic module subroutine bar1(x) real, intent(in) :: x end subroutine bar1 end interface integer x contains ! ! Several hundreds to several thousand lines of code may ! appear here, which separates dummy argument declarations ! from where the dummy arguments are used. !=20 module procedure bar1 print *, x end procedure bar1 end module foo Oh, and at least, this simply test program works with my 2nd patch. program bah use foo real y y =3D 42. call bar(y) end program bah Likely, yet another patch that will sit in bugzilla.=