This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] attributes for gfc_component


Hi Janus,

Janus Weil wrote:
gfc_set_component_attr (gfc_component *c, symbol_attribute *attr)
{
-
- c->dimension = attr->dimension;
- c->pointer = attr->pointer;
- c->allocatable = attr->allocatable;
- c->access = attr->access;
+ c->attr = *attr;
}
I think the function is reduced that much that one should get rid of the complete function.
It is also only used a few times (one set, one get).


You should rather use:
-  gfc_set_component_attr (c, &current_attr);
+ x->attr = current_attr;

- gfc_get_component_attr (&attr, ref->u.c.component);
+ attr = ref->u.c.component->attr;

(and remove it from *.h as well.)

So, would there be any advantages of choosing the other option, or do
you think this patch is the right way to go?
We will waste space in *.mod, but I think that is OK.
(I'm waiting for comments from others.)

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]