This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Problem with contained procedures as of 110063
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Toon Moene <toon at moene dot indiv dot nluug dot nl>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sun, 22 Jan 2006 08:44:27 +0100
- Subject: Re: Problem with contained procedures as of 110063
- References: <200601220322.k0M3M9Rn019577@earth.phy.uc.edu>
Andrew and Toon,
<>This looks like PR 25901.
I think this was caused by one of Paul T.'s patches.
'twas indeed. As I suspected, using patch in the field would shake out
those combinations that I had missed. The following one line patch
fixes the problem.
Index: gcc/fortran/decl.c
===================================================================
*** gcc/fortran/decl.c (revision 110063)
--- gcc/fortran/decl.c (working copy)
*************** get_proc_name (const char *name, gfc_sym
*** 614,619 ****
--- 614,620 ----
/* Trap another encompassed procedure with the same name. */
if (sym->attr.flavor != 0
&& sym->attr.proc != 0
+ && sym->formal
&& (sym->attr.subroutine || sym->attr.function))
gfc_error_now ("Procedure '%s' at %C is already defined at %L",
name, &sym->declared_at);
I do not want to commit it just yet because this new condition is
probably sufficient by itself. I do not know why I did not think of it
in the first place; the effort to find the "already declared" condition
using the attributes was getting seriously tortured.
Please bear with me. I have to do family stuff now but will get back
onto it tonight.
Paul