This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] Fix PR41235, accepts invalid
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Dec 2009 00:50:50 +0100
- Subject: Re: [patch, fortran] Fix PR41235, accepts invalid
- References: <200912082042.21075.franke.daniel@gmail.com> <4B1F82DE.8070904@net-b.de>
On Wednesday 09 December 2009 11:58:38 you wrote:
> On 12/08/2009 08:42 PM, Daniel Franke wrote:
> > Attached patch fixes PR41235, functions with non-constant string length
> > as a return type require an explicit interface.
> >
> > No new testcase as this is already included in
> > gfortran.dg/auto_char_len_4.f90
> >
> > * gfortran.dg/auto_char_len_4.f90: Check for additional error.
>
> I am a bit lost.
And rightly so.
Ignore the last patch, try this updated one instead. The place in interface.c
was wrong and the required check is actually already present in resolve.c
(resolve_fl_procedure) - it just didn't apply in the reporters case. Changed
to check for unknown interfaces instead of explicitely marked external
procedures - the entry_master check is to silence entry_17.f90.
Regression tested on i686-pc-linux-gnu. Ok for trunk (with updated ChangeLog
and testcase from PR)?
Cheers
Daniel
Index: resolve.c
===================================================================
--- resolve.c (revision 155099)
+++ resolve.c (working copy)
@@ -9047,7 +9047,9 @@ resolve_fl_procedure (gfc_symbol *sym, i
return FAILURE;
}
- if (sym->attr.external && sym->formal == NULL
+ if (sym->attr.function
+ && !sym->attr.entry_master
+ && sym->attr.if_source == IFSRC_UNKNOWN
&& cl && cl->length && cl->length->expr_type != EXPR_CONSTANT)
{
gfc_error ("Automatic character length function '%s' at %L must "