public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "janus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/40039] New: Procedures as actual arguments: Check intent of arguments Date: Wed, 06 May 2009 08:51:00 -0000 [thread overview] Message-ID: <bug-40039-16146@http.gcc.gnu.org/bugzilla/> (raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 1375 bytes --] Consider the following module: module m contains subroutine a(x,f) real :: x interface real function f(y) real,intent(in) :: y end function end interface print *,f(x) end subroutine real function func(z) real,intent(inout) :: z func = z**2 end function subroutine caller call a(4.3,func) end subroutine end module ifort complains: error #7061: The characteristics of dummy argument 1 of the associated actual procedure differ from the characteristics of dummy argument 1 of the dummy procedure. (12.2) [FUNC] call a(4.3,func) Although gfortran, g95 and sunf95 accept it, I think ifort is right to reject it (but I haven't checked the standard yet). The same check should also be applied to procedure pointer assignments. Btw "gfortran -Wall -Wextra" produces this warning: test.f90:5: warning: unused parameter f This is bogus, because 'f' *is* used in the subroutine a. -- Summary: Procedures as actual arguments: Check intent of arguments Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: janus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40039
next reply other threads:[~2009-05-06 8:51 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-05-06 8:51 janus at gcc dot gnu dot org [this message] 2009-05-06 10:30 ` [Bug fortran/40039] " burnus at gcc dot gnu dot org 2009-05-07 21:44 ` janus at gcc dot gnu dot org 2009-05-13 17:16 ` janus at gcc dot gnu dot org 2009-05-18 9:19 ` janus at gcc dot gnu dot org 2009-05-18 9:28 ` janus at gcc dot gnu dot org 2009-06-16 9:06 ` janus at gcc dot gnu dot org 2009-06-16 9:17 ` janus 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=bug-40039-16146@http.gcc.gnu.org/bugzilla/ \ --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).