This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, fortran] PR30476 - [Regression 4.2, 4.3] Via other module imported generic interface rejected
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Paul Thomas <paulthomas2 at wanadoo dot fr>
- Cc: Tobias Burnus <burnus at net-b dot de>, Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 17 Jan 2007 20:34:37 -0800
- Subject: Re: [Patch, fortran] PR30476 - [Regression 4.2, 4.3] Via other module imported generic interface rejected
- References: <45ACE57D.10703@wanadoo.fr> <45AD0C96.4050601@net-b.de> <45ADFF0F.3000708@wanadoo.fr>
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