[Patch, fortran] PR30476 - [Regression 4.2, 4.3] Via other module imported generic interface rejected

Steve Kargl sgk@troutmask.apl.washington.edu
Thu Jan 18 04:45:00 GMT 2007


On Wed, Jan 17, 2007 at 11:48:47AM +0100, Paul Thomas wrote:
> >
> >/home/tob/projects/gcc/gcc/fortran/module.c:3100: Warning: the address
> >of "module" will always evaluate as "true"
> >
> >module is defined as:
> >char module[GFC_MAX_SYMBOL_LEN + 1];
> >
> >Maybe it is better to use   if (module[0] && ...  ?
> No, it's better to eliminate that part of the condition completely; it's 
> pure reflex to check that a pointer is there.  Thanks
> 
> This part of the code now reads:
> 
>        {
>          /* Unless sym is a generic interface, this reference
>         is ambiguous.  */
>          gfc_symtree *st;
>          p = p ? p : name;
>          st = gfc_find_symtree (gfc_current_ns->sym_root, p);
>          if (!sym->attr.generic
>            && sym->module != NULL
>            && strcmp(module, sym->module) != 0)
>        st->ambiguous = 1;
>        }
> >
> >Is my assumption correct that  st->ambiguous gets already set correctly
> >via gfc_find_symtree?
> No, st->ambiguous only gets set in two places; both in module.c.
> >
> >I build & regtested it on openSUSE/x86_64 with no new regressions.
> Is it OK with the above change?
> 

Yes. Please commit if you haven't already done so.

__ 
Steve



More information about the Fortran mailing list