This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, Fortran] PROCEDURE declarations
Hi Tobi,
2007/8/31, Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>:
> >> + /* Add current_attr to the symbol attributes. */
> >> + src_attr = (char *) (&(current_attr));
> >> + dest_attr = (char *) (&(sym->attr));
> >> + for (i = 0; i < (int) sizeof (sym->attr); i++)
> >> + {
> >> + *dest_attr = (*dest_attr) | (*src_attr);
> >> + dest_attr++;
> >> + src_attr++;
> >> + }
> >
> > This doesn't make any sense. There's a function gfc_copy_attr() which
> > maybe does what you want.
>
> Sorry, I was overly harsh. Note to self: never look at code five
> minutes before you leave the workplace.
no need to apologize. I think you're completely right (even if
"doesn't make any sense" is really a bit strong). gfc_copy_attr is
exactly what I want. The above piece of code survived from Paul's
original patch and I just never gave it that much thought, because in
principle it does the right thing. But actually it misses out to check
for double attributes, so that for
public:: b
procedure(),public:: b
the was no error issued, but with gfc_copy_attr one gets:
procedure(),public:: b
1
Error: ACCESS specification at (1) was already specified
So, thanks for the bug report. I'll change this at once.
Cheers,
Janus