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/36325] specific or generic INTERFACE implies the EXTERNAL attribute
Date: Mon, 26 May 2008 16:50:00 -0000	[thread overview]
Message-ID: <20080526164926.19154.qmail@sourceware.org> (raw)
In-Reply-To: <bug-36325-14773@http.gcc.gnu.org/bugzilla/>



------- Comment #9 from burnus at gcc dot gnu dot org  2008-05-26 16:49 -------
(In reply to comment #8)
> So we're left with gomp/reduction3.f90, which contains this piece of code:
>   interface
>     function ior (a, b)

>   intrinsic ior
> 
> This produces:
> Error: EXTERNAL attribute conflicts with INTRINSIC attribute at (1)


"C518 An entity shall not have both the EXTERNAL attribute and the INTRINSIC
attribute."

For INTRINSIC one finds also the following, which lifts a related restriction.

"A name that identifies a specific intrinsic function in a scoping unit has a
type as specified in 13.6. An explicit type declaration statement is not
required; however, it is permitted. Specifying a type for a generic intrinsic
function name in a type declaration statement is not sufficient, by itself, to
remove the generic properties from that function."

However, I believe that only means that besides "intrinsic sin" also "real,
intrinsic :: sin" is allows.

I tested the failing interface+intrinsic and all my compilers but gfortran
reject it: ifort, NAG f95, g95, openf95, sunf95.

> I haven't checked the standard on this, but I bet the code is illegal.

I agree.

> And after all: Why should one declare an explicit interface for an intrinsic
> (whose interface is known anyway) ...?

Good question for which I do not know the answer.
But also for "real, intrinsic :: " I don't know the answer, but it is allowed.
(One difference is that one has not the intrinsic vs. external conflict and
that old Fortran programs used it (probably incl. implicit typing). INTERFACE
is F90 and there one wanted to be stricter.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36325


  parent reply	other threads:[~2008-05-26 16:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-25 13:36 [Bug fortran/36325] New: " jaydub66 at gmail dot com
2008-05-25 14:03 ` [Bug fortran/36325] " jaydub66 at gmail dot com
2008-05-25 14:46 ` jaydub66 at gmail dot com
2008-05-25 15:37 ` burnus at gcc dot gnu dot org
2008-05-25 16:37 ` janus at gcc dot gnu dot org
2008-05-25 17:12 ` burnus at gcc dot gnu dot org
2008-05-25 19:09 ` janus at gcc dot gnu dot org
2008-05-25 19:59 ` burnus at gcc dot gnu dot org
2008-05-25 22:33 ` janus at gcc dot gnu dot org
2008-05-26 16:50 ` burnus at gcc dot gnu dot org [this message]
2008-05-26 18:44 ` janus at gcc dot gnu dot org
2008-05-26 20:34 ` burnus at gcc dot gnu dot org
2008-05-28 21:29 ` janus at gcc dot gnu dot org
2008-05-28 21:38 ` 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=20080526164926.19154.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: link
Be 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).