This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] attributes for gfc_component
- From: Tobias Burnus <burnus at net-b dot de>
- To: Janus Weil <jaydub66 at googlemail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 15 Aug 2008 17:35:01 +0200
- Subject: Re: [Patch, Fortran] attributes for gfc_component
- References: <854832d40808150813t4cbc466bv4e2fb4397476f4ab@mail.gmail.com>
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, ¤t_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