[Bug fortran/49110] Deferred-length character result triggers (false positive) error for pure procedures

jwmwalrus at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun May 22 17:01:00 GMT 2011


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

--- Comment #4 from John <jwmwalrus at gmail dot com> 2011-05-22 16:46:32 UTC ---
(In reply to comment #2)
> This patch allows your code to compile, but I 
> don't know if it works correctly.  Do you have
> a complete self-contained small testcase?
> 
> Index: resolve.c
> ===================================================================
> --- resolve.c   (revision 173757)
> +++ resolve.c   (working copy)
> @@ -10305,7 +10305,7 @@ resolve_fl_procedure (gfc_symbol *sym, i
>       actual length; (ii) To declare a named constant; or (iii) External
>       function - but length must be declared in calling scoping unit.  */
>    if (sym->attr.function
> -      && sym->ts.type == BT_CHARACTER
> +      && sym->ts.type == BT_CHARACTER && !sym->ts.deferred
>        && sym->ts.u.cl && sym->ts.u.cl->length == NULL)
>      {
>        if ((sym->as && sym->as->rank) || (sym->attr.pointer)

The module shown is self-contained (it only depends on iso_c_binding, which is
an intrinsic module).  I've added the corresponding source file to this bug as
an attachment.



More information about the Gcc-bugs mailing list