public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/33847] Interface statement not detected: generate Error: Type/rank mismatch Date: Sun, 21 Oct 2007 10:33:00 -0000 [thread overview] Message-ID: <20071021103328.17888.qmail@sourceware.org> (raw) In-Reply-To: <bug-33847-15250@http.gcc.gnu.org/bugzilla/> ------- Comment #2 from burnus at gcc dot gnu dot org 2007-10-21 10:33 ------- I cannot read. You used: interface shape_line_P1 module procedure shape_line_P1, shape_line_P1_2 end interface Thus "shape_line_P1" is both a specific subroutine and a generic subroutine, however, the standard mandates: "If the specific name is also a generic name, only the specific procedure is associated with the dummy argument." And as the specific subroutine "shape_line_P1" does not match the interface of sub's dummy argument "sub1", the program is invalid and the error printed by gfortran and NAG f95 is correct. To fix the program, change: call sub ( shape_line_P1 ) ! wrong specific function into call sub ( shape_line_P1_2 ) ! correct specific function ----------------- Now to the thing I read: interface shape_line_P1 module procedure shape_line_P1_1, shape_line_P1_2 end interface !_________________^^ which means that "shape_line_P1" is only a generic function and not a specific function. However, this is also invalid and properly rejected by gfortran. The standard writes: For "a dummy procedure[...], the associated actual argument shall be the specific name". Here, gfortran writes: "Error: GENERIC non-INTRINSIC procedure 'shape_line_p1' is not allowed as an actual argument" ---------------- Longer excerpt from the Fortran 2003 standard: "12.4.1.3 Actual arguments associated with dummy procedure entities" [...] "If a dummy argument is a dummy procedure without the POINTER attribute, the associated actual argument shall be the specific name of an external, module, dummy, or intrinsic procedure, an associated procedure pointer, or a reference to a function that returns an associated procedure pointer. The only intrinsic procedures permitted are those listed in 13.6 and not marked with a bullet (*). If the specific name is also a generic name, only the specific procedure is associated with the dummy argument." ---------------------------- Closed as invalid on this basis of this analysis. Nonetheless, thanks for reporting bugs in general - as user feedback is essential to iron out bugs and sometimes it is not obvious whether something is a bug or not. -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu dot | |org Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33847
prev parent reply other threads:[~2007-10-21 10:33 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-10-21 6:53 [Bug fortran/33847] New: " m dot a dot hulsen at tue dot nl 2007-10-21 10:07 ` [Bug fortran/33847] " burnus at gcc dot gnu dot org 2007-10-21 10:33 ` burnus at gcc dot gnu dot org [this message]
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=20071021103328.17888.qmail@sourceware.org \ --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).