public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jaydub66 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/36325] specific or generic INTERFACE implies the EXTERNAL attribute
Date: Sun, 25 May 2008 14:03:00 -0000	[thread overview]
Message-ID: <20080525140223.11659.qmail@sourceware.org> (raw)
In-Reply-To: <bug-36325-14773@http.gcc.gnu.org/bugzilla/>



------- Comment #1 from jaydub66 at gmail dot com  2008-05-25 14:02 -------
Here is a first patch:

Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c        (revision 135859)
+++ gcc/fortran/symbol.c        (working copy)
@@ -439,7 +439,7 @@ check_conflict (symbol_attribute *attr, 
   conf (external, intrinsic);
   conf (entry, intrinsic);

-  if ((attr->if_source && !attr->procedure) || attr->contained)
+  if ((attr->if_source == IFSRC_DECL && !attr->procedure) || attr->contained)
     {
       conf (external, subroutine);
       conf (external, function);
Index: gcc/fortran/parse.c
===================================================================
--- gcc/fortran/parse.c (revision 135859)
+++ gcc/fortran/parse.c (working copy)
@@ -1917,12 +1917,26 @@ loop:
       new_state = COMP_SUBROUTINE;
       gfc_add_explicit_interface (gfc_new_block, IFSRC_IFBODY,
                                  gfc_new_block->formal, NULL);
+      if (current_interface.type != INTERFACE_ABSTRACT &&
+        gfc_add_external (&gfc_new_block->attr, &gfc_current_locus) ==
FAILURE)
+       {
+         reject_statement ();
+         gfc_free_namespace (gfc_current_ns);
+         goto loop;
+       }
       break;

     case ST_FUNCTION:
       new_state = COMP_FUNCTION;
       gfc_add_explicit_interface (gfc_new_block, IFSRC_IFBODY,
                                  gfc_new_block->formal, NULL);
+      if (current_interface.type != INTERFACE_ABSTRACT &&
+        gfc_add_external (&gfc_new_block->attr, &gfc_current_locus) ==
FAILURE)
+       {
+         reject_statement ();
+         gfc_free_namespace (gfc_current_ns);
+         goto loop;
+       }
       break;

     case ST_PROCEDURE:


This removes the conflict between EXTERNAL and SUBROUTINE for this case, and
adds the EXTERNAL attribute for a non-abstract INTERFACE statement.

Checking for regressions ...


-- 


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


  reply	other threads:[~2008-05-25 14:03 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 ` jaydub66 at gmail dot com [this message]
2008-05-25 14:46 ` [Bug fortran/36325] " 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
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=20080525140223.11659.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).