This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/53956] Proc-pointer w/ interface: Bogus "EXTERNAL attribute conflicts with FUNCTION attribute"
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 14 Jul 2012 13:01:22 +0000
- Subject: [Bug fortran/53956] Proc-pointer w/ interface: Bogus "EXTERNAL attribute conflicts with FUNCTION attribute"
- Auto-submitted: auto-generated
- References: <bug-53956-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53956
--- Comment #3 from janus at gcc dot gnu.org 2012-07-14 13:01:22 UTC ---
(In reply to comment #2)
> Plus, I'm not
> sure why the error only occurs with the PROCEDURE statement.
Regarding the test case in comment #1, the difference between the c2-args of
'sub' and 'fp' is that the former has IFSRC_UNKNOWN, while the latter has
IFSRC_DECL.
The latter symbol is created by 'gfc_copy_formal_args', and therefore an
alternative (and probably preferable) patch would be:
Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c (revision 189470)
+++ gcc/fortran/symbol.c (working copy)
@@ -4110,7 +4110,7 @@ gfc_copy_formal_args (gfc_symbol *dest, gfc_symbol
}
/* Add the interface to the symbol. */
- add_proc_interface (dest, IFSRC_DECL, head);
+ add_proc_interface (dest, src->attr.if_source, head);
/* Store the formal namespace information. */
if (dest->formal != NULL)
> However, there seems to be an additional problem with the locus.
... which is not a real problem, I guess (since the error message is fake
anyway).