public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mhesseli at caltech dot edu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/21961] New: PURE function in INTERFACE block not resolved as being a function Date: Wed, 08 Jun 2005 14:35:00 -0000 [thread overview] Message-ID: <20050608143534.21961.mhesseli@caltech.edu> (raw) A PURE function that is part of an INTERFACE block is not resolved as being a function. Gfortran gives the following warning for the code attached at the end of this description: module_procedure-1.f90: In function 'show': module_procedure-1.f90:30: warning: unused variable 'test' I originally tested this using GNU Fortran 95 (GCC 4.1.0 20050602 (experimental)) and retested it using GNU Fortran 95 (GCC 4.1.0 20050608 (experimental)). --- MODULE procedures PUBLIC :: test PRIVATE :: test1,test2 INTERFACE test MODULE PROCEDURE test1,test2 END INTERFACE test CONTAINS PURE FUNCTION test1 (x) RESULT(r) REAL(KIND(0.0d0)), INTENT(IN) :: x REAL(KIND(0.0d0)) :: r r=x+1.0d0 END FUNCTION test1 PURE FUNCTION test2 (x) RESULT(r) REAL(KIND(0.0d0)), DIMENSION(:), INTENT(IN) :: x REAL(KIND(0.0d0)), DIMENSION(SIZE(x)) :: r FORALL (i=1:SIZE(x)) r(i)=x(i)+1.0d0 END FORALL END FUNCTION test2 END MODULE procedures MODULE actions USE procedures CONTAINS SUBROUTINE show (x) REAL(KIND(0.0d0)), DIMENSION(:) :: x REAL(KIND(0.0d0)), DIMENSION(SIZE(x)) :: d d=test (x) WRITE (*,'(F8.6)') d END SUBROUTINE show END MODULE actions PROGRAM module_procedure_1 USE actions REAL(KIND(0.0d0)), DIMENSION(2) :: x x=(/ 1.0d0,0.0d0 /) CALL show (x) END PROGRAM module_procedure_1 -- Summary: PURE function in INTERFACE block not resolved as being a function Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mhesseli at caltech dot edu CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: powerpc-apple-darwin7.9.0 GCC host triplet: powerpc-apple-darwin7.9.0 GCC target triplet: powerpc-apple-darwin7.9.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21961
next reply other threads:[~2005-06-08 14:35 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-06-08 14:35 mhesseli at caltech dot edu [this message] 2005-06-18 18:42 ` [Bug fortran/21961] " fxcoudert at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20050608143534.21961.mhesseli@caltech.edu \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).