On Sat, Feb 22, 2014 at 04:38:52PM +0100, Mikael Morin wrote:
> > +
> > +bool
> > +gfc_deferred_strlen (gfc_component *c, tree *decl)
> > +{
> > +  char name[GFC_MAX_SYMBOL_LEN+1];

Shouldn't this be +2?

> > +  gfc_component *strlen;
> > +  if (!(c->ts.type == BT_CHARACTER && c->ts.deferred))
> > +    return false;
> > +  sprintf (name, "_%s", c->name);

One for NULL termination and one for '_' character.

> > +  for (strlen = c; strlen; strlen = strlen->next)
> > +    if (strcmp (strlen->name, name) == 0)
> > +      break;
> maybe gfc_find_component could be used here.
> 
> > +  *decl = strlen ? strlen->backend_decl : NULL_TREE;
> > +  return strlen != NULL;
> > +}

-- 
Steve

Reply via email to